From 35cda1c22c4ba4300fbf6fa34c2d1b7e4c572e07 Mon Sep 17 00:00:00 2001 From: Tvangeste Date: Wed, 26 Dec 2012 18:16:21 +0100 Subject: [PATCH] Name print, save, zoomIn, zoomOut and zoomBase buttons for convenient CSS styling. --- mainwindow.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/mainwindow.cc b/mainwindow.cc index ecb5dfbb..57487f1a 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -123,17 +123,29 @@ MainWindow::MainWindow( Config::Class & cfg_ ): this, SLOT( pronounce() ) ); // zooming - navToolbar->addSeparator(); + // named separator (to be able to hide it via CSS) + navToolbar->widgetForAction( navToolbar->addSeparator() )->setObjectName( "separatorBeforeZoom" ); + zoomIn = navToolbar->addAction( QIcon( ":/icons/icon32_zoomin.png" ), tr( "Zoom In" ) ); zoomIn->setShortcut( QKeySequence::ZoomIn ); + navToolbar->widgetForAction( zoomIn )->setObjectName( "zoomInButton" ); + zoomOut = navToolbar->addAction( QIcon( ":/icons/icon32_zoomout.png" ), tr( "Zoom Out" ) ); zoomOut->setShortcut( QKeySequence::ZoomOut ); + navToolbar->widgetForAction( zoomOut )->setObjectName( "zoomOutButton" ); + zoomBase = navToolbar->addAction( QIcon( ":/icons/icon32_zoombase.png" ), tr( "Normal Size" ) ); zoomBase->setShortcut( QKeySequence( "Ctrl+0" ) ); + navToolbar->widgetForAction( zoomBase )->setObjectName( "zoomBaseButton" ); + + // named separator (to be able to hide it via CSS) + navToolbar->widgetForAction( navToolbar->addSeparator() )->setObjectName( "separatorBeforeSave" ); - navToolbar->addSeparator(); navToolbar->addAction( ui.saveArticle ); + navToolbar->widgetForAction( ui.saveArticle )->setObjectName( "saveArticleButton" ); + navToolbar->addAction( ui.print ); + navToolbar->widgetForAction( ui.print )->setObjectName( "printButton" ); // Make the search pane's titlebar groupLabel.setText( tr( "Look up in:" ) );