From 829ca05e755eabec7366540fdb2f85029667b7c3 Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Sun, 18 Dec 2016 19:16:21 +0300 Subject: [PATCH] (GUI) Added new icon (:/Stop), increased default icon size --- profiler_gui/blocks_tree_widget.cpp | 1 + profiler_gui/descriptors_tree_widget.cpp | 1 + profiler_gui/globals.h | 1 + profiler_gui/icons/attribution.txt | 1 + profiler_gui/icons/stop.svg | 43 ++++++++++++++++++++++++ profiler_gui/main_window.cpp | 14 +++++++- profiler_gui/resources.qrc | 1 + 7 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 profiler_gui/icons/stop.svg diff --git a/profiler_gui/blocks_tree_widget.cpp b/profiler_gui/blocks_tree_widget.cpp index c7fd4d3..91f4e5b 100644 --- a/profiler_gui/blocks_tree_widget.cpp +++ b/profiler_gui/blocks_tree_widget.cpp @@ -1149,6 +1149,7 @@ EasyHierarchyWidget::EasyHierarchyWidget(QWidget* _parent) : Parent(_parent) menu->addAction(a); auto tb = new QToolBar(this); + tb->setIconSize(::profiler_gui::ICONS_SIZE); tb->setContentsMargins(0, 0, 0, 0); tb->addAction(m_searchButton); tb->addWidget(m_searchBox); diff --git a/profiler_gui/descriptors_tree_widget.cpp b/profiler_gui/descriptors_tree_widget.cpp index 5c47716..23fa536 100644 --- a/profiler_gui/descriptors_tree_widget.cpp +++ b/profiler_gui/descriptors_tree_widget.cpp @@ -732,6 +732,7 @@ EasyDescWidget::EasyDescWidget(QWidget* _parent) : Parent(_parent) m_searchBox->setContentsMargins(5, 0, 0, 0); auto tb = new QToolBar(this); + tb->setIconSize(::profiler_gui::ICONS_SIZE); auto refreshButton = tb->addAction(QIcon(":/Reload"), tr("Refresh blocks list")); refreshButton->setEnabled(EASY_GLOBALS.connected); refreshButton->setToolTip(tr("Refresh blocks list.\nConnection needed.")); diff --git a/profiler_gui/globals.h b/profiler_gui/globals.h index 14b41ea..e2a35cf 100644 --- a/profiler_gui/globals.h +++ b/profiler_gui/globals.h @@ -69,6 +69,7 @@ namespace profiler_gui { const qreal SCALING_COEFFICIENT = 1.25; const qreal SCALING_COEFFICIENT_INV = 1.0 / SCALING_COEFFICIENT; + const QSize ICONS_SIZE(28, 28); const uint16_t GRAPHICS_ROW_SIZE = 18; const uint16_t GRAPHICS_ROW_SPACING = 2; const uint16_t GRAPHICS_ROW_SIZE_FULL = GRAPHICS_ROW_SIZE + GRAPHICS_ROW_SPACING; diff --git a/profiler_gui/icons/attribution.txt b/profiler_gui/icons/attribution.txt index 2acd148..8b476f5 100644 --- a/profiler_gui/icons/attribution.txt +++ b/profiler_gui/icons/attribution.txt @@ -16,6 +16,7 @@ lan_on.svg - Icon made by Freepik from www.flaticon.com wifi.svg - Icon made by Freepik from www.flaticon.com wifi_on.svg - Icon made by Freepik from www.flaticon.com play.svg - Icon made by Google from www.flaticon.com +stop.svg - Icon made by Google from www.flaticon.com delete.svg - Icon made by Freepik from www.flaticon.com list.svg - Icon made by Freepik from www.flaticon.com search-prev.svg - Icon made by Freepik from www.flaticon.com diff --git a/profiler_gui/icons/stop.svg b/profiler_gui/icons/stop.svg new file mode 100644 index 0000000..964b50d --- /dev/null +++ b/profiler_gui/icons/stop.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/profiler_gui/main_window.cpp b/profiler_gui/main_window.cpp index 87abe11..10bc511 100644 --- a/profiler_gui/main_window.cpp +++ b/profiler_gui/main_window.cpp @@ -163,6 +163,7 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_lastAddress("localhost"), m_lastP auto toolbar = addToolBar("FileToolbar"); + toolbar->setIconSize(::profiler_gui::ICONS_SIZE); toolbar->setObjectName("ProfilerGUI_FileToolbar"); toolbar->setContentsMargins(1, 0, 1, 0); @@ -189,6 +190,7 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_lastAddress("localhost"), m_lastP toolbar = addToolBar("ProfileToolbar"); + toolbar->setIconSize(::profiler_gui::ICONS_SIZE); toolbar->setObjectName("ProfilerGUI_ProfileToolbar"); toolbar->setContentsMargins(1, 0, 1, 0); @@ -225,6 +227,7 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_lastAddress("localhost"), m_lastP toolbar = addToolBar("SetupToolbar"); + toolbar->setIconSize(::profiler_gui::ICONS_SIZE); toolbar->setObjectName("ProfilerGUI_SetupToolbar"); toolbar->setContentsMargins(1, 0, 1, 0); @@ -493,6 +496,7 @@ EasyMainWindow::EasyMainWindow() : Parent(), m_lastAddress("localhost"), m_lastP auto tb_height = toolbar->height() + 4; toolbar = addToolBar("FrameToolbar"); + toolbar->setIconSize(::profiler_gui::ICONS_SIZE); toolbar->setObjectName("ProfilerGUI_FrameToolbar"); toolbar->setContentsMargins(1, 0, 1, 0); toolbar->setMinimumHeight(tb_height); @@ -1595,7 +1599,15 @@ void EasyMainWindow::onCaptureClicked(bool) m_listenerTimer.start(250); m_listenerDialog = new QMessageBox(QMessageBox::Information, "Capturing frames...", "Close this dialog to stop capturing.", QMessageBox::NoButton, this); - m_listenerDialog->addButton("Stop", QMessageBox::AcceptRole); + + auto button = new QToolButton(m_listenerDialog); + button->setAutoRaise(true); + button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + button->setIconSize(::profiler_gui::ICONS_SIZE); + button->setIcon(QIcon(":/Stop")); + button->setText("Stop"); + m_listenerDialog->addButton(button, QMessageBox::AcceptRole); + m_listenerDialog->setAttribute(Qt::WA_DeleteOnClose, true); connect(m_listenerDialog, &QDialog::finished, this, &This::onListenerDialogClose); m_listenerDialog->show(); diff --git a/profiler_gui/resources.qrc b/profiler_gui/resources.qrc index 8bc879d..1b5c988 100644 --- a/profiler_gui/resources.qrc +++ b/profiler_gui/resources.qrc @@ -19,6 +19,7 @@ icons/lan.svg icons/lan_on.svg icons/play.svg + icons/stop.svg icons/delete.svg icons/list.svg icons/search-next.svg