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
Marco Bubke
flatpak-qt-creator
Commits
7b52a2ab
Commit
7b52a2ab
authored
Sep 06, 2010
by
kh1
Browse files
Add QActions instead of QToolButtons. Makes the "Expand Toolbar"button
work. Task-number: QTCREATORBUG-2255
parent
51625f88
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/sidebar.cpp
View file @
7b52a2ab
...
...
@@ -325,22 +325,21 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id)
m_toolbar
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_toolbar
->
addWidget
(
m_comboBox
);
m_splitButton
=
new
QToolButton
;
m_splitButton
->
setIcon
(
QIcon
(
QLatin1String
(
Constants
::
ICON_SPLIT_HORIZONTAL
)));
m_splitButton
->
setToolTip
(
tr
(
"Split"
));
connect
(
m_splitButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SIGNAL
(
splitMe
()));
m_closeButton
=
new
QToolButton
;
m_closeButton
->
setIcon
(
QIcon
(
QLatin1String
(
Constants
::
ICON_CLOSE
)));
m_closeButton
->
setToolTip
(
tr
(
"Close"
));
connect
(
m_closeButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SIGNAL
(
closeMe
()));
QWidget
*
spacerItem
=
new
QWidget
(
this
);
spacerItem
->
setSizePolicy
(
QSizePolicy
::
Expanding
,
QSizePolicy
::
Minimum
);
m_toolbar
->
addWidget
(
spacerItem
);
m_splitAction
=
m_toolbar
->
addWidget
(
m_splitButton
);
m_toolbar
->
addWidget
(
m_closeButton
);
m_splitAction
=
new
QAction
(
tr
(
"Split"
),
m_toolbar
);
m_splitAction
->
setToolTip
(
tr
(
"Split"
));
m_splitAction
->
setIcon
(
QIcon
(
QLatin1String
(
Constants
::
ICON_SPLIT_HORIZONTAL
)));
connect
(
m_splitAction
,
SIGNAL
(
triggered
()),
this
,
SIGNAL
(
splitMe
()));
m_toolbar
->
addAction
(
m_splitAction
);
QAction
*
closeAction
=
new
QAction
(
tr
(
"Close"
),
m_toolbar
);
closeAction
->
setToolTip
(
tr
(
"Close"
));
closeAction
->
setIcon
(
QIcon
(
QLatin1String
(
Constants
::
ICON_CLOSE
)));
connect
(
closeAction
,
SIGNAL
(
triggered
()),
this
,
SIGNAL
(
closeMe
()));
m_toolbar
->
addAction
(
closeAction
);
QVBoxLayout
*
lay
=
new
QVBoxLayout
();
lay
->
setMargin
(
0
);
...
...
@@ -427,7 +426,7 @@ void SideBarWidget::updateAvailableItems()
idx
=
0
;
m_comboBox
->
setCurrentIndex
(
idx
);
m_split
Butt
on
->
setEnabled
(
titleList
.
count
()
>
1
);
m_split
Acti
on
->
setEnabled
(
titleList
.
count
()
>
1
);
m_comboBox
->
blockSignals
(
blocked
);
}
...
...
src/plugins/coreplugin/sidebar.h
View file @
7b52a2ab
...
...
@@ -179,8 +179,6 @@ private:
QAction
*
m_splitAction
;
QList
<
QAction
*>
m_addedToolBarActions
;
SideBar
*
m_sideBar
;
QToolButton
*
m_splitButton
;
QToolButton
*
m_closeButton
;
};
class
ComboBox
:
public
QComboBox
...
...
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