Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
a97bc8d8
Commit
a97bc8d8
authored
Mar 16, 2013
by
Sebastian Eichelbaum
Browse files
[ADD] added help button to all docks. Not yet working.
parent
09284952
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
resources/qt4gui/share/openwalnut/qt4gui/questionmark.png
resources/qt4gui/share/openwalnut/qt4gui/questionmark.png
+0
-0
src/qt4gui/guiElements/WQtDockTitleWidget.cpp
src/qt4gui/guiElements/WQtDockTitleWidget.cpp
+15
-1
src/qt4gui/guiElements/WQtDockTitleWidget.h
src/qt4gui/guiElements/WQtDockTitleWidget.h
+5
-0
No files found.
resources/qt4gui/share/openwalnut/qt4gui/questionmark.png
0 → 100644
View file @
a97bc8d8
811 Bytes
src/qt4gui/guiElements/WQtDockTitleWidget.cpp
View file @
a97bc8d8
...
...
@@ -102,11 +102,22 @@ void WQtDockTitleWidget::construct()
moreMenu
->
addAction
(
moreAction
);
m_moreBtn
->
setMenu
(
moreMenu
);
// help button
m_helpBtn
=
new
QToolButton
(
this
);
QAction
*
helpAction
=
new
QAction
(
WQt4Gui
::
getMainWindow
()
->
getIconManager
()
->
getIcon
(
"questionmark"
),
"Help"
,
this
);
connect
(
helpAction
,
SIGNAL
(
triggered
(
bool
)
),
dockParent
,
SLOT
(
showHelp
()
)
);
m_helpBtn
->
setDefaultAction
(
helpAction
);
setupButton
(
m_helpBtn
);
setupSizeConstraints
(
m_helpBtn
);
m_helpBtn
->
setMinimumSize
(
24
,
24
);
m_helpBtn
->
setMaximumSize
(
24
,
24
);
// fill layout
titleWidgetLayout
->
addWidget
(
m_title
);
titleWidgetLayout
->
addStretch
(
100000
);
titleWidgetLayout
->
addWidget
(
m_tools
);
titleWidgetLayout
->
addWidget
(
m_moreBtn
);
titleWidgetLayout
->
addWidget
(
m_helpBtn
);
titleWidgetLayout
->
addWidget
(
m_closeBtn
);
}
...
...
@@ -194,7 +205,10 @@ void WQtDockTitleWidget::addTitleSeperator()
void
WQtDockTitleWidget
::
updateLayouts
(
int
width
)
{
// calc the size of widgets and the title and the mandatory close button
int
minRequired
=
m_title
->
calculateSize
(
m_title
->
text
().
length
()
)
+
m_moreBtn
->
sizeHint
().
width
()
+
m_closeBtn
->
sizeHint
().
width
();
int
minRequired
=
m_title
->
calculateSize
(
m_title
->
text
().
length
()
)
+
m_moreBtn
->
sizeHint
().
width
()
+
m_helpBtn
->
isVisible
()
*
m_helpBtn
->
sizeHint
().
width
()
+
m_closeBtn
->
sizeHint
().
width
();
// check and move items
int
curWidth
=
minRequired
;
...
...
src/qt4gui/guiElements/WQtDockTitleWidget.h
View file @
a97bc8d8
...
...
@@ -159,6 +159,11 @@ private:
*/
QToolButton
*
m_closeBtn
;
/**
* Help button
*/
QToolButton
*
m_helpBtn
;
/**
* The parent as dock pointer
*/
...
...
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