mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:45:44 +00:00
UI: Fix icon tool buttons
This commit is contained in:
parent
2a6a22ed4b
commit
686e1f1af0
@ -27,10 +27,8 @@ void AppInfoRow::setupUi()
|
||||
auto layout = new QHBoxLayout();
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
m_btAppCopyPath =
|
||||
ControlUtil::createFlatToolButton(":/icons/page_copy.png", Qt::ToolButtonIconOnly);
|
||||
m_btAppOpenFolder =
|
||||
ControlUtil::createFlatToolButton(":/icons/folder.png", Qt::ToolButtonIconOnly);
|
||||
m_btAppCopyPath = ControlUtil::createIconToolButton(":/icons/page_copy.png");
|
||||
m_btAppOpenFolder = ControlUtil::createIconToolButton(":/icons/folder.png");
|
||||
|
||||
m_lineAppPath = ControlUtil::createLineLabel();
|
||||
|
||||
|
@ -123,10 +123,10 @@ QToolButton *ControlUtil::createToolButton(
|
||||
return c;
|
||||
}
|
||||
|
||||
QToolButton *ControlUtil::createFlatToolButton(const QString &iconPath, Qt::ToolButtonStyle style)
|
||||
QToolButton *ControlUtil::createFlatToolButton(const QString &iconPath)
|
||||
{
|
||||
auto c = createToolButton(iconPath);
|
||||
c->setToolButtonStyle(style);
|
||||
c->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
|
||||
c->setCursor(Qt::PointingHandCursor);
|
||||
c->setAutoRaise(true);
|
||||
c->setFocusPolicy(Qt::TabFocus);
|
||||
@ -143,11 +143,18 @@ QToolButton *ControlUtil::createFlatToolButton(
|
||||
return c;
|
||||
}
|
||||
|
||||
QToolButton *ControlUtil::createIconToolButton(const QString &iconPath)
|
||||
{
|
||||
auto c = createFlatToolButton(iconPath);
|
||||
c->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
return c;
|
||||
}
|
||||
|
||||
QToolButton *ControlUtil::createSplitterButton(
|
||||
const QString &iconPath, const std::function<void()> &onClicked)
|
||||
{
|
||||
auto c = createFlatToolButton(iconPath, onClicked);
|
||||
c->setCursor(Qt::ArrowCursor);
|
||||
c->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
c->setFixedSize(32, 32);
|
||||
return c;
|
||||
}
|
||||
|
@ -50,11 +50,12 @@ public:
|
||||
static QToolButton *createToolButton(
|
||||
const QString &iconPath, const std::function<void()> &onClicked);
|
||||
|
||||
static QToolButton *createFlatToolButton(
|
||||
const QString &iconPath, Qt::ToolButtonStyle style = Qt::ToolButtonTextBesideIcon);
|
||||
static QToolButton *createFlatToolButton(const QString &iconPath);
|
||||
static QToolButton *createFlatToolButton(
|
||||
const QString &iconPath, const std::function<void()> &onClicked);
|
||||
|
||||
static QToolButton *createIconToolButton(const QString &iconPath);
|
||||
|
||||
static QToolButton *createSplitterButton(
|
||||
const QString &iconPath, const std::function<void()> &onClicked);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user