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
OpenFlipper-Free
OpenFlipper
Commits
0fe01d2e
Commit
0fe01d2e
authored
May 31, 2016
by
Hans-Christian Ebke
Browse files
Added customizable widget into whitespace in side pane elements.
parent
9e60f06f
Changes
2
Hide whitespace changes
Inline
Side-by-side
widgets/coreWidget/SideElement.cc
View file @
0fe01d2e
...
...
@@ -98,7 +98,13 @@ SideElement::SideElement (SideArea *_parent, QWidget *_w, QString _name, QIcon*
detachButton_
->
setAutoRaise
(
true
);
hl
->
addWidget
(
iconHolder_
);
hl
->
addWidget
(
label_
);
hl
->
addStretch
(
1
);
QWidget
*
stretcher_wdgt
=
new
QWidget
(
this
);
stretcher_wdgt
->
setObjectName
(
"ChildControlArea"
);
connect
(
this
,
SIGNAL
(
toggleActive
(
bool
)),
stretcher_wdgt
,
SLOT
(
setVisible
(
bool
)));
stretcher_wdgt
->
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Minimum
);
stretcher_wdgt
->
setVisible
(
false
);
hl
->
addWidget
(
stretcher_wdgt
);
hl
->
addStretch
(
1
);
hl
->
addWidget
(
detachButton_
);
...
...
@@ -161,6 +167,8 @@ void SideElement::labelPress ()
QFont
font
;
font
.
setBold
(
active_
);
label_
->
setFont
(
font
);
emit
toggleActive
(
active_
);
}
}
...
...
@@ -175,6 +183,7 @@ void SideElement::setActive(bool _active)
}
else
{
const
bool
doEmit
=
(
active_
!=
_active
);
active_
=
_active
;
if
(
active_
)
widget_
->
show
();
...
...
@@ -184,6 +193,8 @@ void SideElement::setActive(bool _active)
QFont
font
;
font
.
setBold
(
active_
);
label_
->
setFont
(
font
);
if
(
doEmit
)
emit
toggleActive
(
active_
);
}
}
...
...
@@ -261,7 +272,9 @@ void SideElement::restoreState (QSettings &_settings)
{
_settings
.
beginGroup
(
name_
);
active_
=
_settings
.
value
(
"Active"
,
active_
).
toBool
();
bool
active
=
_settings
.
value
(
"Active"
,
active_
).
toBool
();
const
bool
doEmit
=
(
active_
!=
active
);
active_
=
active
;
if
(
active_
)
widget_
->
show
();
...
...
@@ -272,6 +285,8 @@ void SideElement::restoreState (QSettings &_settings)
font
.
setBold
(
active_
);
label_
->
setFont
(
font
);
if
(
doEmit
)
emit
toggleActive
(
active_
);
if
(
_settings
.
value
(
"Detached"
,
false
).
toBool
()
&&
!
dialog_
)
detachPressed
(
true
);
...
...
widgets/coreWidget/SideElement.hh
View file @
0fe01d2e
...
...
@@ -117,6 +117,9 @@ class SideElement : public QWidget
/// returns the pointer to the plugin tool widget
QWidget
const
*
widget
();
signals:
void
toggleActive
(
bool
);
private:
/// Clickable area inside of the side element.
...
...
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