forked from qt-creator/qt-creator
Core: Turn progress detail expander into a real icon
Change-Id: Ie6173cc041b96cd10879189bedce1104cdbe7a33 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
BIN
src/libs/utils/images/toggleprogressdetails.png
Normal file
BIN
src/libs/utils/images/toggleprogressdetails.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 167 B |
BIN
src/libs/utils/images/toggleprogressdetails@2x.png
Normal file
BIN
src/libs/utils/images/toggleprogressdetails@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 216 B |
@@ -219,6 +219,8 @@
|
|||||||
<file>images/settings@2x.png</file>
|
<file>images/settings@2x.png</file>
|
||||||
<file>images/sort_alphabetically.png</file>
|
<file>images/sort_alphabetically.png</file>
|
||||||
<file>images/sort_alphabetically@2x.png</file>
|
<file>images/sort_alphabetically@2x.png</file>
|
||||||
|
<file>images/toggleprogressdetails.png</file>
|
||||||
|
<file>images/toggleprogressdetails@2x.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/codemodel">
|
<qresource prefix="/codemodel">
|
||||||
<file>images/enum.png</file>
|
<file>images/enum.png</file>
|
||||||
|
@@ -188,6 +188,8 @@ const Icon LINK_TOOLBAR({
|
|||||||
{QLatin1String(":/utils/images/linkicon.png"), Theme::IconsBaseColor}});
|
{QLatin1String(":/utils/images/linkicon.png"), Theme::IconsBaseColor}});
|
||||||
const Icon SORT_ALPHABETICALLY_TOOLBAR({
|
const Icon SORT_ALPHABETICALLY_TOOLBAR({
|
||||||
{QLatin1String(":/utils/images/sort_alphabetically.png"), Theme::IconsBaseColor}});
|
{QLatin1String(":/utils/images/sort_alphabetically.png"), Theme::IconsBaseColor}});
|
||||||
|
const Icon TOGGLE_PROGRESSDETAILS_TOOLBAR({
|
||||||
|
{QLatin1String(":/utils/images/toggleprogressdetails.png"), Theme::IconsBaseColor}});
|
||||||
|
|
||||||
const Icon WARNING({
|
const Icon WARNING({
|
||||||
{QLatin1String(":/utils/images/warningfill.png"), Theme::BackgroundColorNormal},
|
{QLatin1String(":/utils/images/warningfill.png"), Theme::BackgroundColorNormal},
|
||||||
|
@@ -109,6 +109,7 @@ QTCREATOR_UTILS_EXPORT extern const Icon FILTER;
|
|||||||
QTCREATOR_UTILS_EXPORT extern const Icon LINK;
|
QTCREATOR_UTILS_EXPORT extern const Icon LINK;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon LINK_TOOLBAR;
|
QTCREATOR_UTILS_EXPORT extern const Icon LINK_TOOLBAR;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon SORT_ALPHABETICALLY_TOOLBAR;
|
QTCREATOR_UTILS_EXPORT extern const Icon SORT_ALPHABETICALLY_TOOLBAR;
|
||||||
|
QTCREATOR_UTILS_EXPORT extern const Icon TOGGLE_PROGRESSDETAILS_TOOLBAR;
|
||||||
|
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon INFO;
|
QTCREATOR_UTILS_EXPORT extern const Icon INFO;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon INFO_TOOLBAR;
|
QTCREATOR_UTILS_EXPORT extern const Icon INFO_TOOLBAR;
|
||||||
|
@@ -39,6 +39,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
@@ -319,7 +320,7 @@ void ProgressManagerPrivate::init()
|
|||||||
m_summaryProgressBar->setCancelEnabled(false);
|
m_summaryProgressBar->setCancelEnabled(false);
|
||||||
m_summaryProgressLayout->addWidget(m_summaryProgressBar);
|
m_summaryProgressLayout->addWidget(m_summaryProgressBar);
|
||||||
layout->addWidget(m_summaryProgressWidget);
|
layout->addWidget(m_summaryProgressWidget);
|
||||||
auto toggleButton = new ToggleButton(m_statusBarWidget);
|
auto toggleButton = new QToolButton(m_statusBarWidget);
|
||||||
layout->addWidget(toggleButton);
|
layout->addWidget(toggleButton);
|
||||||
m_statusBarWidget->installEventFilter(this);
|
m_statusBarWidget->installEventFilter(this);
|
||||||
StatusBarManager::addStatusBarWidget(m_statusBarWidget, StatusBarManager::RightCorner);
|
StatusBarManager::addStatusBarWidget(m_statusBarWidget, StatusBarManager::RightCorner);
|
||||||
@@ -327,10 +328,7 @@ void ProgressManagerPrivate::init()
|
|||||||
QAction *toggleProgressView = new QAction(tr("Toggle Progress Details"), this);
|
QAction *toggleProgressView = new QAction(tr("Toggle Progress Details"), this);
|
||||||
toggleProgressView->setCheckable(true);
|
toggleProgressView->setCheckable(true);
|
||||||
toggleProgressView->setChecked(m_progressViewPinned);
|
toggleProgressView->setChecked(m_progressViewPinned);
|
||||||
// we have to set an transparent icon to prevent the tool button to show text
|
toggleProgressView->setIcon(Utils::Icons::TOGGLE_PROGRESSDETAILS_TOOLBAR.icon());
|
||||||
QPixmap p(1, 1);
|
|
||||||
p.fill(Qt::transparent);
|
|
||||||
toggleProgressView->setIcon(QIcon(p));
|
|
||||||
Command *cmd = ActionManager::registerAction(toggleProgressView,
|
Command *cmd = ActionManager::registerAction(toggleProgressView,
|
||||||
"QtCreator.ToggleProgressDetails");
|
"QtCreator.ToggleProgressDetails");
|
||||||
|
|
||||||
@@ -712,33 +710,6 @@ void ProgressManagerPrivate::progressDetailsToggled(bool checked)
|
|||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
ToggleButton::ToggleButton(QWidget *parent)
|
|
||||||
: QToolButton(parent)
|
|
||||||
{
|
|
||||||
setToolButtonStyle(Qt::ToolButtonIconOnly);
|
|
||||||
if (creatorTheme()->flag(Theme::FlatToolBars)) {
|
|
||||||
QPalette p = palette();
|
|
||||||
p.setBrush(QPalette::Base, creatorTheme()->color(Theme::ToggleButtonBackgroundColor));
|
|
||||||
setPalette(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize ToggleButton::sizeHint() const
|
|
||||||
{
|
|
||||||
return QSize(13, 12); // Uneven width, because the arrow's width is also uneven.
|
|
||||||
}
|
|
||||||
|
|
||||||
void ToggleButton::paintEvent(QPaintEvent *event)
|
|
||||||
{
|
|
||||||
QToolButton::paintEvent(event);
|
|
||||||
QPainter p(this);
|
|
||||||
QStyleOption arrowOpt;
|
|
||||||
arrowOpt.initFrom(this);
|
|
||||||
arrowOpt.rect.adjust(2, 0, -1, -2);
|
|
||||||
StyleHelper::drawArrow(QStyle::PE_IndicatorArrowUp, &p, &arrowOpt);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ProgressManager::ProgressManager() = default;
|
ProgressManager::ProgressManager() = default;
|
||||||
|
|
||||||
ProgressManager::~ProgressManager() = default;
|
ProgressManager::~ProgressManager() = default;
|
||||||
|
@@ -112,14 +112,5 @@ private:
|
|||||||
bool m_hovered = false;
|
bool m_hovered = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ToggleButton : public QToolButton
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
ToggleButton(QWidget *parent);
|
|
||||||
QSize sizeHint() const override;
|
|
||||||
void paintEvent(QPaintEvent *event) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
@@ -3607,6 +3607,45 @@
|
|||||||
width="100%"
|
width="100%"
|
||||||
height="100%" />
|
height="100%" />
|
||||||
</g>
|
</g>
|
||||||
|
<g
|
||||||
|
style="display:inline"
|
||||||
|
transform="translate(160)"
|
||||||
|
id="src/libs/utils/images/toggleprogressdetails">
|
||||||
|
<use
|
||||||
|
style="display:inline"
|
||||||
|
transform="translate(1740,132)"
|
||||||
|
height="100%"
|
||||||
|
width="100%"
|
||||||
|
id="use4105-8-8"
|
||||||
|
xlink:href="#backgroundRect"
|
||||||
|
y="0"
|
||||||
|
x="0" />
|
||||||
|
<rect
|
||||||
|
style="display:inline;fill:#707070"
|
||||||
|
id="rect2566"
|
||||||
|
width="8"
|
||||||
|
height="2"
|
||||||
|
x="1726"
|
||||||
|
y="577" />
|
||||||
|
<rect
|
||||||
|
style="display:inline;fill:none;stroke:#000000"
|
||||||
|
id="rect2564"
|
||||||
|
width="13"
|
||||||
|
height="3"
|
||||||
|
x="1725.5"
|
||||||
|
y="576.5"
|
||||||
|
ry="1"
|
||||||
|
rx="1" />
|
||||||
|
<use
|
||||||
|
transform="matrix(1,0,0,-1,1529,1167)"
|
||||||
|
style="display:inline"
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
xlink:href="#expandarrow"
|
||||||
|
id="use2507"
|
||||||
|
width="100%"
|
||||||
|
height="100%" />
|
||||||
|
</g>
|
||||||
</g>
|
</g>
|
||||||
<g
|
<g
|
||||||
inkscape:groupmode="layer"
|
inkscape:groupmode="layer"
|
||||||
@@ -6593,7 +6632,7 @@
|
|||||||
<path
|
<path
|
||||||
sodipodi:nodetypes="cccc"
|
sodipodi:nodetypes="cccc"
|
||||||
inkscape:connector-curvature="0"
|
inkscape:connector-curvature="0"
|
||||||
id="path4784-17"
|
id="expandarrow"
|
||||||
d="m 210,595 -2.5,2.5 -2.5,-2.5 z"
|
d="m 210,595 -2.5,2.5 -2.5,-2.5 z"
|
||||||
style="fill:#000000;fill-opacity:1;stroke:none" />
|
style="fill:#000000;fill-opacity:1;stroke:none" />
|
||||||
</g>
|
</g>
|
||||||
|
Before Width: | Height: | Size: 374 KiB After Width: | Height: | Size: 375 KiB |
Reference in New Issue
Block a user