Skip to content

Commit

Permalink
Reload icons for dark theme in highlighters dialog (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed Sep 25, 2020
1 parent b5ccbd3 commit dcc0622
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
25 changes: 17 additions & 8 deletions src/ui/src/highlightersdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
* along with klogg. If not, see <http://www.gnu.org/licenses/>.
*/

#include "log.h"

#include "highlighterset.h"

#include "highlightersdialog.h"

#include <QFileDialog>
#include <QTimer>

#include <utility>

#include "highlightersdialog.h"
#include "highlighterset.h"
#include "iconloader.h"
#include "log.h"

static constexpr QLatin1String DEFAULT_NAME = QLatin1String( "New Highlighter set", 19 );

// Construct the box, including a copy of the global highlighterSet
Expand All @@ -59,8 +59,8 @@ HighlightersDialog::HighlightersDialog( QWidget* parent )
highlighterSetEdit_->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
highlighterLayout->addWidget( highlighterSetEdit_ );

splitter->setStretchFactor(0, 0);
splitter->setStretchFactor(1, 1);
splitter->setStretchFactor( 0, 0 );
splitter->setStretchFactor( 1, 1 );

// Reload the highlighter list from disk (in case it has been changed
// by another glogg instance) and copy it to here.
Expand Down Expand Up @@ -100,6 +100,15 @@ HighlightersDialog::HighlightersDialog( QWidget* parent )
if ( !highlighterSetCollection_.highlighters_.empty() ) {
setCurrentRow( 0 );
}

QTimer::singleShot( 0, [this] {
IconLoader iconLoader( this );

addHighlighterButton->setIcon( iconLoader.load( "icons8-plus-16" ) );
removeHighlighterButton->setIcon( iconLoader.load( "icons8-minus-16" ) );
upHighlighterButton->setIcon( iconLoader.load( "icons8-up-16" ) );
downHighlighterButton->setIcon( iconLoader.load( "icons8-down-arrow-16" ) );
} );
}

//
Expand Down
20 changes: 15 additions & 5 deletions src/ui/src/highlightersetedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@
* along with klogg. If not, see <http://www.gnu.org/licenses/>.
*/

#include "log.h"
#include <QColorDialog>
#include <QTimer>

#include "highlighterset.h"
#include <utility>

#include "highlighterset.h"
#include "highlightersetedit.h"

#include <QColorDialog>
#include <QTimer>
#include <utility>
#include "iconloader.h"
#include "log.h"

namespace {
static constexpr QLatin1String DEFAULT_PATTERN = QLatin1String( "New Highlighter", 15 );
Expand Down Expand Up @@ -89,6 +90,15 @@ HighlighterSetEdit::HighlighterSetEdit( QWidget* parent )

connect( highlighterEdit_, &HighlighterEdit::changed, this,
&HighlighterSetEdit::updateHighlighterProperties );

QTimer::singleShot( 0, [this] {
IconLoader iconLoader( this );

addHighlighterButton->setIcon( iconLoader.load( "icons8-plus-16" ) );
removeHighlighterButton->setIcon( iconLoader.load( "icons8-minus-16" ) );
upHighlighterButton->setIcon( iconLoader.load( "icons8-up-16" ) );
downHighlighterButton->setIcon( iconLoader.load( "icons8-down-arrow-16" ) );
} );
}

void HighlighterSetEdit::reset()
Expand Down

0 comments on commit dcc0622

Please # to comment.