From d8afccdcb6aee43312f8a036ff07acdcc59d33ea Mon Sep 17 00:00:00 2001 From: Garux Date: Sun, 5 Oct 2025 14:38:07 +0500 Subject: [PATCH] more svg icons --- libs/gtkutil/dialog.cpp | 5 ++-- radiant/entityinspector.cpp | 29 ++++++++++--------- radiant/layerswindow.cpp | 2 +- setup/data/tools/bitmaps/arrow_left.svg | 12 ++++++++ setup/data/tools/bitmaps/arrow_left_right.svg | 13 +++++++++ setup/data/tools/bitmaps/delete.svg | 16 ++++++++++ setup/data/tools/bitmaps/select.svg | 10 +++++++ 7 files changed, 69 insertions(+), 18 deletions(-) create mode 100644 setup/data/tools/bitmaps/arrow_left.svg create mode 100644 setup/data/tools/bitmaps/arrow_left_right.svg create mode 100644 setup/data/tools/bitmaps/delete.svg create mode 100644 setup/data/tools/bitmaps/select.svg diff --git a/libs/gtkutil/dialog.cpp b/libs/gtkutil/dialog.cpp index dc04fec4..c0a1b3e6 100644 --- a/libs/gtkutil/dialog.cpp +++ b/libs/gtkutil/dialog.cpp @@ -28,8 +28,7 @@ #include #include #include -#include -#include +#include "gtkutil/image.h" RadioHBox RadioHBox_new( StringArrayRange names ){ @@ -49,7 +48,7 @@ RadioHBox RadioHBox_new( StringArrayRange names ){ PathEntry PathEntry_new(){ auto *entry = new QLineEdit; - auto *button = entry->addAction( QApplication::style()->standardIcon( QStyle::SP_DialogOpenButton ), QLineEdit::ActionPosition::TrailingPosition ); + auto *button = entry->addAction( new_local_icon( "ellipsis.png" ), QLineEdit::ActionPosition::TrailingPosition ); return PathEntry( entry, button ); } diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 1ebbb95f..d49836cd 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include "gtkutil/combobox.h" @@ -66,6 +65,7 @@ #include "gtkutil/filechooser.h" #include "gtkutil/nonmodal.h" #include "gtkutil/entry.h" +#include "gtkutil/image.h" #include "qe3.h" #include "gtkmisc.h" @@ -244,7 +244,7 @@ public: m_key( key ), m_entry( new NonModalEntry( ApplyCaller( *this ), UpdateCaller( *this ) ) ){ m_entry->setValidator( new KeyValueValidator( m_entry ) ); - auto *button = m_entry->addAction( QApplication::style()->standardIcon( QStyle::SP_ArrowRight ), QLineEdit::ActionPosition::TrailingPosition ); + auto *button = m_entry->addAction( new_local_icon( "ellipsis.png" ), QLineEdit::ActionPosition::TrailingPosition ); QObject::connect( button, &QAction::triggered, [this](){ browse(); } ); } void release() override { @@ -283,7 +283,7 @@ public: m_key( key ), m_entry( new NonModalEntry( ApplyCaller( *this ), UpdateCaller( *this ) ) ){ m_entry->setValidator( new KeyValueValidator( m_entry ) ); - auto *button = m_entry->addAction( QApplication::style()->standardIcon( QStyle::SP_DialogOpenButton ), QLineEdit::ActionPosition::TrailingPosition ); + auto *button = m_entry->addAction( new_local_icon( "ellipsis.png" ), QLineEdit::ActionPosition::TrailingPosition ); QObject::connect( button, &QAction::triggered, [this](){ browse(); } ); } void release() override { @@ -347,7 +347,7 @@ public: m_key( key ), m_entry( new NonModalEntry( ApplyCaller( *this ), UpdateCaller( *this ) ) ){ m_entry->setValidator( new KeyValueValidator( m_entry ) ); - auto *button = m_entry->addAction( QApplication::style()->standardIcon( QStyle::SP_MediaVolume ), QLineEdit::ActionPosition::TrailingPosition ); + auto *button = m_entry->addAction( new_local_icon( "ellipsis.png" ), QLineEdit::ActionPosition::TrailingPosition ); QObject::connect( button, &QAction::triggered, [this](){ browse(); } ); } void release() override { @@ -1287,7 +1287,7 @@ QWidget* EntityInspector_constructWindow( QWidget* toplevel ){ /* select by key/value buttons */ { auto *b = new QToolButton; - b->setText( "+" ); + b->setIcon( new_local_icon( "select.png" ) ); b->setToolTip( "Select by key" ); grid->addWidget( b, 0, 2 ); QObject::connect( b, &QAbstractButton::clicked, [](){ @@ -1296,7 +1296,7 @@ QWidget* EntityInspector_constructWindow( QWidget* toplevel ){ } { auto *b = new QToolButton; - b->setText( "+" ); + b->setIcon( new_local_icon( "select.png" ) ); b->setToolTip( "Select by value" ); grid->addWidget( b, 1, 2 ); QObject::connect( b, &QAbstractButton::clicked, [](){ @@ -1305,7 +1305,7 @@ QWidget* EntityInspector_constructWindow( QWidget* toplevel ){ } { auto *b = new QToolButton; - b->setText( "+" ); + b->setIcon( new_local_icon( "select.png" ) ); b->setToolTip( "Select by key + value" ); grid->addWidget( b, 0, 3, 2, 1 ); QObject::connect( b, &QAbstractButton::clicked, [](){ @@ -1330,23 +1330,24 @@ QWidget* EntityInspector_constructWindow( QWidget* toplevel ){ { auto *b = new QToolButton; hbox->addWidget( b ); - b->setText( "<" ); + b->setIcon( new_local_icon( "arrow_left.png" ) ); b->setToolTip( "Select targeting entities" ); QObject::connect( b, &QAbstractButton::clicked, [](){ Select_ConnectedEntities( true, false, g_focusToggleButton->isChecked() ); } ); } { auto *b = new QToolButton; hbox->addWidget( b ); - b->setText( ">" ); - b->setToolTip( "Select targets" ); - QObject::connect( b, &QAbstractButton::clicked, [](){ Select_ConnectedEntities( false, true, g_focusToggleButton->isChecked() ); } ); + b->setIconSize( QSize( b->iconSize().width() * 2, b->iconSize().height() ) ); + b->setIcon( new_local_icon( "arrow_left_right.png" ) ); + b->setToolTip( "Select connected entities" ); + QObject::connect( b, &QAbstractButton::clicked, [](){ Select_ConnectedEntities( true, true, g_focusToggleButton->isChecked() ); } ); } { auto *b = new QToolButton; hbox->addWidget( b ); - b->setText( "<->" ); - b->setToolTip( "Select connected entities" ); - QObject::connect( b, &QAbstractButton::clicked, [](){ Select_ConnectedEntities( true, true, g_focusToggleButton->isChecked() ); } ); + b->setIcon( new_local_icon( "arrow_right.png" ) ); + b->setToolTip( "Select targets" ); + QObject::connect( b, &QAbstractButton::clicked, [](){ Select_ConnectedEntities( false, true, g_focusToggleButton->isChecked() ); } ); } { auto *b = g_focusToggleButton = new QToolButton; diff --git a/radiant/layerswindow.cpp b/radiant/layerswindow.cpp index 8519896d..33a451ad 100644 --- a/radiant/layerswindow.cpp +++ b/radiant/layerswindow.cpp @@ -379,7 +379,7 @@ void context_menu( const QPoint& pos ){ layer_new( item, layer, layers, tree ); } ); - menu->addAction( QApplication::style()->standardIcon( QStyle::SP_DialogCloseButton ), "Delete", [&](){ + menu->addAction( new_local_icon( "delete.png" ), "Delete", [&](){ auto dels = item_getLayers( item ); auto it = item_getLayerIterator( item ); diff --git a/setup/data/tools/bitmaps/arrow_left.svg b/setup/data/tools/bitmaps/arrow_left.svg new file mode 100644 index 00000000..777c403a --- /dev/null +++ b/setup/data/tools/bitmaps/arrow_left.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/setup/data/tools/bitmaps/arrow_left_right.svg b/setup/data/tools/bitmaps/arrow_left_right.svg new file mode 100644 index 00000000..87dbe10c --- /dev/null +++ b/setup/data/tools/bitmaps/arrow_left_right.svg @@ -0,0 +1,13 @@ + + + + + + diff --git a/setup/data/tools/bitmaps/delete.svg b/setup/data/tools/bitmaps/delete.svg new file mode 100644 index 00000000..9488b4fd --- /dev/null +++ b/setup/data/tools/bitmaps/delete.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/setup/data/tools/bitmaps/select.svg b/setup/data/tools/bitmaps/select.svg new file mode 100644 index 00000000..62f098f4 --- /dev/null +++ b/setup/data/tools/bitmaps/select.svg @@ -0,0 +1,10 @@ + + + + + + +