Skip to content
Permalink
Browse files
Switch browser dock buttons to toolbar
  • Loading branch information
nyalldawson committed May 30, 2015
1 parent 2ab8a0b commit 5a93f4c501afde6130ccc1717ad3b6dd3e7ff58b
Showing with 87 additions and 140 deletions.
  1. +6 −11 src/app/qgsbrowserdockwidget.cpp
  2. +81 −129 src/ui/qgsbrowserdockwidgetbase.ui
@@ -447,11 +447,6 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QString name, QWidget * parent ) :
mBrowserView = new QgsDockBrowserTreeView( this );
mLayoutBrowser->addWidget( mBrowserView );

mBtnRefresh->setIcon( QgsApplication::getThemeIcon( "mActionDraw.svg" ) );
mBtnAddLayers->setIcon( QgsApplication::getThemeIcon( "mActionAdd.svg" ) );
mBtnCollapse->setIcon( QgsApplication::getThemeIcon( "mActionCollapseTree.svg" ) );
mBtnPropertiesWidget->setIcon( QgsApplication::getThemeIcon( "mActionPropertiesWidget.svg" ) );

mWidgetFilter->hide();
mLeFilter->setPlaceholderText( tr( "Type here to filter current item..." ) );
// icons from http://www.fatcow.com/free-icons License: CC Attribution 3.0
@@ -483,11 +478,11 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( QString name, QWidget * parent ) :
action->setCheckable( true );
menu->addAction( action );

connect( mBtnRefresh, SIGNAL( clicked() ), this, SLOT( refresh() ) );
connect( mBtnAddLayers, SIGNAL( clicked() ), this, SLOT( addSelectedLayers() ) );
connect( mBtnCollapse, SIGNAL( clicked() ), mBrowserView, SLOT( collapseAll() ) );
connect( mBtnFilterShow, SIGNAL( toggled( bool ) ), this, SLOT( showFilterWidget( bool ) ) );
connect( mBtnPropertiesWidget, SIGNAL( toggled( bool ) ), this, SLOT( enablePropertiesWidget( bool ) ) );
connect( mActionRefresh, SIGNAL( triggered( bool ) ), this, SLOT( refresh() ) );
connect( mActionAddLayers, SIGNAL( triggered( bool ) ), this, SLOT( addSelectedLayers() ) );
connect( mActionCollapse, SIGNAL( triggered( bool ) ), mBrowserView, SLOT( collapseAll() ) );
connect( mActionShowFilter, SIGNAL( triggered( bool ) ), this, SLOT( showFilterWidget( bool ) ) );
connect( mActionPropertiesWidget, SIGNAL( triggered( bool ) ), this, SLOT( enablePropertiesWidget( bool ) ) );
connect( mLeFilter, SIGNAL( returnPressed() ), this, SLOT( setFilter() ) );
connect( mLeFilter, SIGNAL( cleared() ), this, SLOT( setFilter() ) );
connect( mLeFilter, SIGNAL( textChanged( const QString & ) ), this, SLOT( setFilter() ) );
@@ -530,7 +525,7 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
// objectName used by settingsSection() is not yet set in constructor
QSettings settings;
mPropertiesWidgetEnabled = settings.value( settingsSection() + "/propertiesWidgetEnabled", false ).toBool();
mBtnPropertiesWidget->setChecked( mPropertiesWidgetEnabled );
mActionPropertiesWidget->setChecked( mPropertiesWidgetEnabled );
mPropertiesWidget->setVisible( false ); // false until item is selected

mPropertiesWidgetHeight = settings.value( settingsSection() + "/propertiesWidgetHeight" ).toFloat();
@@ -7,14 +7,17 @@
<x>0</x>
<y>0</y>
<width>216</width>
<height>121</height>
<height>138</height>
</rect>
</property>
<property name="windowTitle">
<string>Browser</string>
</property>
<widget class="QWidget" name="mContents">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
@@ -28,136 +31,22 @@
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="mLayoutHeader">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>5</number>
<widget class="QToolBar" name="mBrowserToolbar">
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="rightMargin">
<number>5</number>
<property name="floatable">
<bool>false</bool>
</property>
<item>
<widget class="QToolButton" name="mBtnRefresh">
<property name="toolTip">
<string>Refresh</string>
</property>
<property name="text">
<string>Refresh</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionDraw.svg</normaloff>:/images/themes/default/mActionDraw.svg</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mBtnAddLayers">
<property name="toolTip">
<string>Add Selected Layers</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionAdd.svg</normaloff>:/images/themes/default/mActionAdd.svg</iconset>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mBtnFilterShow">
<property name="toolTip">
<string>Filter Files</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionFilter2.svg</normaloff>:/images/themes/default/mActionFilter2.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mBtnCollapse">
<property name="toolTip">
<string>Collapse All</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionCollapseTree.png</normaloff>:/images/themes/default/mActionCollapseTree.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mBtnPropertiesWidget">
<property name="toolTip">
<string>Enable / disable properties widget</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionPropertiesWidget.png</normaloff>:/images/themes/default/mActionPropertiesWidget.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
<addaction name="mActionRefresh"/>
<addaction name="mActionAddLayers"/>
<addaction name="mActionShowFilter"/>
<addaction name="mActionCollapse"/>
<addaction name="mActionPropertiesWidget"/>
</widget>
</item>
<item>
<widget class="QWidget" name="mWidgetFilter" native="true">
@@ -301,6 +190,69 @@
</item>
</layout>
</widget>
<action name="mActionRefresh">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionDraw.svg</normaloff>:/images/themes/default/mActionDraw.svg</iconset>
</property>
<property name="text">
<string>Refresh</string>
</property>
</action>
<action name="mActionAddLayers">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionAdd.svg</normaloff>:/images/themes/default/mActionAdd.svg</iconset>
</property>
<property name="text">
<string>Add Layers</string>
</property>
<property name="toolTip">
<string>Add Selected Layers</string>
</property>
</action>
<action name="mActionShowFilter">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionFilter2.svg</normaloff>:/images/themes/default/mActionFilter2.svg</iconset>
</property>
<property name="text">
<string>Filter browser</string>
</property>
<property name="toolTip">
<string>Filter Browser</string>
</property>
</action>
<action name="mActionCollapse">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionCollapseTree.svg</normaloff>:/images/themes/default/mActionCollapseTree.svg</iconset>
</property>
<property name="text">
<string>Collapse All</string>
</property>
<property name="toolTip">
<string>Collapse All</string>
</property>
</action>
<action name="mActionPropertiesWidget">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionPropertiesWidget.svg</normaloff>:/images/themes/default/mActionPropertiesWidget.svg</iconset>
</property>
<property name="text">
<string>Show Properties</string>
</property>
<property name="toolTip">
<string>Enable/disable properties widget</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

0 comments on commit 5a93f4c

Please sign in to comment.