Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Tusooa Zhu
Krita
Commits
b6e4af65
Commit
b6e4af65
authored
Aug 19, 2015
by
Scott Petrovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix themed icons on the kis widget chooser
parent
a725ae17
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
krita/ui/kis_paintop_box.cc
krita/ui/kis_paintop_box.cc
+4
-0
krita/ui/widgets/kis_widget_chooser.cpp
krita/ui/widgets/kis_widget_chooser.cpp
+15
-1
krita/ui/widgets/kis_widget_chooser.h
krita/ui/widgets/kis_widget_chooser.h
+1
-0
No files found.
krita/ui/kis_paintop_box.cc
View file @
b6e4af65
...
...
@@ -197,6 +197,7 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
m_sliderChooser
[
i
]
=
new
KisWidgetChooser
(
i
+
1
);
KisDoubleSliderSpinBox
*
slOpacity
;
KisDoubleSliderSpinBox
*
slFlow
;
KisDoubleSliderSpinBox
*
slSize
;
...
...
@@ -289,16 +290,19 @@ KisPaintopBox::KisPaintopBox(KisViewManager *view, QWidget *parent, const char *
view
->
actionCollection
()
->
addAction
(
"brushslider1"
,
action
);
action
->
setDefaultWidget
(
m_sliderChooser
[
0
]);
connect
(
action
,
SIGNAL
(
triggered
()),
m_sliderChooser
[
0
],
SLOT
(
showPopupWidget
()));
connect
(
m_viewManager
->
mainWindow
(),
SIGNAL
(
themeChanged
()),
m_sliderChooser
[
0
],
SLOT
(
updateThemedIcons
()));
action
=
new
KAction
(
i18n
(
"Brush option slider 2"
),
this
);
view
->
actionCollection
()
->
addAction
(
"brushslider2"
,
action
);
action
->
setDefaultWidget
(
m_sliderChooser
[
1
]);
connect
(
action
,
SIGNAL
(
triggered
()),
m_sliderChooser
[
1
],
SLOT
(
showPopupWidget
()));
connect
(
m_viewManager
->
mainWindow
(),
SIGNAL
(
themeChanged
()),
m_sliderChooser
[
1
],
SLOT
(
updateThemedIcons
()));
action
=
new
KAction
(
i18n
(
"Brush option slider 3"
),
this
);
view
->
actionCollection
()
->
addAction
(
"brushslider3"
,
action
);
action
->
setDefaultWidget
(
m_sliderChooser
[
2
]);
connect
(
action
,
SIGNAL
(
triggered
()),
m_sliderChooser
[
2
],
SLOT
(
showPopupWidget
()));
connect
(
m_viewManager
->
mainWindow
(),
SIGNAL
(
themeChanged
()),
m_sliderChooser
[
2
],
SLOT
(
updateThemedIcons
()));
action
=
new
KAction
(
i18n
(
"Next Favourite Preset"
),
this
);
view
->
actionCollection
()
->
addAction
(
"next_favorite_preset"
,
action
);
...
...
krita/ui/widgets/kis_widget_chooser.cpp
View file @
b6e4af65
...
...
@@ -31,6 +31,8 @@
#include <QStylePainter>
#include <QStyleOption>
#include <kis_icon_utils.h>
#include "kis_config.h"
KisWidgetChooser
::
KisWidgetChooser
(
int
id
,
QWidget
*
parent
)
...
...
@@ -39,7 +41,7 @@ KisWidgetChooser::KisWidgetChooser(int id, QWidget* parent)
{
// QFrame::setFrameStyle(QFrame::StyledPanel|QFrame::Raised);
m_acceptIcon
=
theme
dIcon
(
"list-add"
);
m_acceptIcon
=
KisIconUtils
::
loa
dIcon
(
"list-add"
);
m_buttons
=
new
QButtonGroup
();
m_popup
=
new
QFrame
(
0
,
Qt
::
Popup
);
m_arrowButton
=
new
QToolButton
();
...
...
@@ -138,6 +140,8 @@ QLayout* KisWidgetChooser::createPopupLayout()
if
(
!
i
->
choosen
)
{
if
(
row
==
buttons
.
size
())
{
QToolButton
*
bn
=
new
QToolButton
();
m_acceptIcon
=
KisIconUtils
::
loadIcon
(
"list-add"
);
bn
->
setIcon
(
m_acceptIcon
);
bn
->
setAutoRaise
(
true
);
buttons
.
push_back
(
bn
);
...
...
@@ -245,6 +249,16 @@ void KisWidgetChooser::showPopupWidget()
m_popup
->
show
();
}
void
KisWidgetChooser
::
updateThemedIcons
()
{
for
(
int
i
=
0
;
i
<
m_buttons
->
buttons
().
length
();
i
++
)
{
if
(
m_buttons
->
button
(
i
))
{
m_buttons
->
button
(
i
)
->
setIcon
(
KisIconUtils
::
loadIcon
(
"list-add"
));
}
}
}
void
KisWidgetChooser
::
slotButtonPressed
()
{
showPopupWidget
();
...
...
krita/ui/widgets/kis_widget_chooser.h
View file @
b6e4af65
...
...
@@ -76,6 +76,7 @@ public:
public
Q_SLOTS
:
void
showPopupWidget
();
void
updateThemedIcons
();
private:
void
removeWidget
(
const
QString
&
id
);
...
...
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