Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
677872ba
Commit
677872ba
authored
Feb 20, 2022
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 20, 2022
Browse files
No hover feedback for separators
parent
91a63b72
Pipeline
#140214
passed with stage
in 2 minutes and 44 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
kate/kateurlbar.cpp
View file @
677872ba
...
...
@@ -348,7 +348,11 @@ Q_SIGNALS:
void
navigateLeftRight
(
int
key
);
};
enum
BreadCrumbRole
{
PathRole
=
Qt
::
UserRole
+
1
,
IsSeparator
,
IsSymbolCrumb
};
enum
BreadCrumbRole
{
PathRole
=
Qt
::
UserRole
+
1
,
IsSeparator
,
IsSymbolCrumb
,
};
class
BreadCrumbDelegate
:
public
QStyledItemDelegate
{
...
...
@@ -360,7 +364,16 @@ public:
{
QStyledItemDelegate
::
initStyleOption
(
o
,
idx
);
o
->
decorationAlignment
=
Qt
::
AlignCenter
;
// We always want this icon size and nothing bigger
o
->
decorationSize
=
QSize
(
16
,
16
);
if
(
o
->
state
&
QStyle
::
State_MouseOver
)
{
// No hover feedback for separators
if
(
idx
.
data
(
BreadCrumbRole
::
IsSeparator
).
toBool
())
{
o
->
state
.
setFlag
(
QStyle
::
State_MouseOver
,
false
);
o
->
state
.
setFlag
(
QStyle
::
State_Active
,
false
);
}
}
}
QSize
sizeHint
(
const
QStyleOptionViewItem
&
opt
,
const
QModelIndex
&
idx
)
const
override
...
...
@@ -717,7 +730,6 @@ public:
urlBarLayout
->
addWidget
(
m_sepLabel
);
urlBarLayout
->
addWidget
(
m_breadCrumbView
);
m_sepLabel
->
setPixmap
(
QIcon
::
fromTheme
(
QStringLiteral
(
"arrow-right"
)).
pixmap
(
16
,
16
));
m_sepLabel
->
setContentsMargins
({});
setFocusProxy
(
m_breadCrumbView
);
...
...
@@ -747,8 +759,13 @@ public:
});
}
}
if
(
!
m_currBranchBtn
->
defaultAction
())
if
(
!
m_currBranchBtn
->
defaultAction
())
{
m_currBranchBtn
->
hide
();
m_sepLabel
->
hide
();
}
else
{
// Setup the icon now
m_sepLabel
->
setPixmap
(
QIcon
::
fromTheme
(
QStringLiteral
(
"arrow-right"
)).
pixmap
(
16
,
16
));
}
});
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment