Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ui] Move property override button css to default style sheet
  • Loading branch information
nirvn committed Feb 9, 2019
1 parent bfbb75a commit bf5b3f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/app/qgisappstylesheet.cpp
Expand Up @@ -163,6 +163,11 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
"}" )
.arg( palette.highlight().color().name(),
palette.highlightedText().color().name() );

ss += QStringLiteral( "QgsPropertyOverrideButton { background: none; border: 1px solid rgba(0, 0, 0, 0%); } QgsPropertyOverrideButton:focus { border: 1px solid palette(highlight); }" );
#ifdef Q_OS_MACX
ss += QStringLiteral( "QgsPropertyOverrideButton::menu-indicator { width: 5px; }" );
#endif
}

QgsDebugMsg( QStringLiteral( "Stylesheet built: %1" ).arg( ss ) );
Expand Down
6 changes: 0 additions & 6 deletions src/gui/qgspropertyoverridebutton.cpp
Expand Up @@ -46,12 +46,6 @@ QgsPropertyOverrideButton::QgsPropertyOverrideButton( QWidget *parent,

// button width is 1.25 * icon size, height 1.1 * icon size. But we round to ensure even pixel sizes for equal margins
setFixedSize( 2 * static_cast< int >( 1.25 * iconSize / 2.0 ), 2 * static_cast< int >( iconSize * 1.1 / 2.0 ) );
QString ss;
ss += QStringLiteral( "QToolButton{ background: none; border: 1px solid rgba(0, 0, 0, 0%); } QToolButton:focus { border: 1px solid palette(highlight); }" );
#ifdef Q_OS_MACX
ss += QStringLiteral( "QToolButton::menu-indicator{ width: 5px; }" );
#endif
setStyleSheet( ss );

setIconSize( QSize( iconSize, iconSize ) );
setPopupMode( QToolButton::InstantPopup );
Expand Down

0 comments on commit bf5b3f0

Please sign in to comment.