Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Okular
Commits
ad8b35a6
Commit
ad8b35a6
authored
Jul 24, 2016
by
Martin Tobias Holmedahl Sandsmark
Browse files
Fix updating of palette in sidebar
parent
06edec49
Changes
2
Hide whitespace changes
Inline
Side-by-side
ui/sidebar.cpp
View file @
ad8b35a6
...
...
@@ -77,12 +77,14 @@ class SidebarDelegate : public QAbstractItemDelegate
void
setShowText
(
bool
show
);
bool
isTextShown
()
const
;
void
updateBrushCache
();
// from QAbstractItemDelegate
void
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
;
QSize
sizeHint
(
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
;
private
slots
:
void
updateBrushCache
();
private:
bool
m_showText
;
QScopedPointer
<
KStatefulBrush
>
m_windowBackground
;
...
...
@@ -97,6 +99,7 @@ SidebarDelegate::SidebarDelegate( QObject *parent )
m_selectionBackground
(
0
),
m_selectionForeground
(
0
)
{
updateBrushCache
();
connect
(
qApp
,
&
QGuiApplication
::
paletteChanged
,
this
,
&
SidebarDelegate
::
updateBrushCache
);
}
SidebarDelegate
::~
SidebarDelegate
()
...
...
@@ -502,8 +505,6 @@ Sidebar::Sidebar( QWidget *parent )
connect
(
d
->
list
,
&
SidebarListWidget
::
customContextMenuRequested
,
this
,
&
Sidebar
::
listContextMenu
);
connect
(
d
->
splitter
,
&
QSplitter
::
splitterMoved
,
this
,
&
Sidebar
::
splitterMoved
);
connect
(
KGlobalSettings
::
self
(),
&
KGlobalSettings
::
appearanceChanged
,
this
,
&
Sidebar
::
appearanceChanged
);
setCollapsed
(
true
);
setFocusProxy
(
d
->
list
);
}
...
...
@@ -798,11 +799,6 @@ void Sidebar::iconSizeChanged( QAction *action )
Okular
::
Settings
::
self
()
->
save
();
}
void
Sidebar
::
appearanceChanged
()
{
d
->
sideDelegate
->
updateBrushCache
();
}
void
Sidebar
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
{
event
->
setAccepted
(
event
->
mimeData
()
->
hasUrls
()
);
...
...
ui/sidebar.h
View file @
ad8b35a6
...
...
@@ -58,7 +58,6 @@ class Sidebar : public QWidget
void
listContextMenu
(
const
QPoint
&
);
void
showTextToggled
(
bool
);
void
iconSizeChanged
(
QAction
*
action
);
void
appearanceChanged
();
private:
void
setIndexEnabled
(
int
index
,
bool
enabled
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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