Skip to content

Commit

Permalink
Fix 'actions' button in attribute table dialog only shows menu after
Browse files Browse the repository at this point in the history
extended click and hold

(cherry-picked from 556668e)
  • Loading branch information
nyalldawson committed Apr 2, 2018
1 parent deac239 commit 07f939e
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 81 deletions.
8 changes: 8 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QgsAttr
mActionVisibleFilter->setIcon( filterIcon );
mActionEditedFilter->setIcon( filterIcon );

mActionFeatureActions = new QToolButton();
mActionFeatureActions->setAutoRaise( false );
mActionFeatureActions->setPopupMode( QToolButton::InstantPopup );
mActionFeatureActions->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mAction.svg" ) ) );
mActionFeatureActions->setText( tr( "Actions" ) );
mActionFeatureActions->setToolTip( tr( "Actions" ) );
mToolbar->addWidget( mActionFeatureActions );

// Connect filter signals
connect( mActionAdvancedFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterExpressionBuilder );
connect( mActionShowAllFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterShowAll );
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsattributetabledialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib

private:
QMenu *mMenuActions = nullptr;
QToolButton *mActionFeatureActions = nullptr;

QgsDockWidget *mDock = nullptr;
QgsDistanceArea *myDa = nullptr;
Expand Down
180 changes: 99 additions & 81 deletions src/ui/qgsattributetabledialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,77 @@
<property name="spacing">
<number>3</number>
</property>
<item row="6" column="0">
<widget class="QgsDualView" name="mMainView">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QFrame" name="mUpdateExpressionBox">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QgsFieldComboBox" name="mFieldCombo"/>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>=</string>
</property>
</widget>
</item>
<item>
<widget class="QgsFieldExpressionWidget" name="mUpdateExpressionText" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mRunFieldCalc">
<property name="text">
<string>Update All</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mRunFieldCalcSelected">
<property name="text">
<string>Update Selected</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="8" column="0">
<layout class="QHBoxLayout">
<property name="leftMargin">
Expand Down Expand Up @@ -189,78 +260,6 @@
<addaction name="separator"/>
<addaction name="mActionSetStyles"/>
<addaction name="separator"/>
<addaction name="mActionFeatureActions"/>
</widget>
</item>
<item row="6" column="0">
<widget class="QgsDualView" name="mMainView">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QFrame" name="mUpdateExpressionBox">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QgsFieldComboBox" name="mFieldCombo"/>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>=</string>
</property>
</widget>
</item>
<item>
<widget class="QgsFieldExpressionWidget" name="mUpdateExpressionText" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mRunFieldCalc">
<property name="text">
<string>Update All</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mRunFieldCalcSelected">
<property name="text">
<string>Update Selected</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
Expand Down Expand Up @@ -634,15 +633,6 @@
<string>Conditional formatting</string>
</property>
</action>
<action name="mActionFeatureActions">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mAction.svg</normaloff>:/images/themes/default/mAction.svg</iconset>
</property>
<property name="text">
<string>Actions</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand Down Expand Up @@ -681,6 +671,34 @@
</tabstops>
<resources>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>
Expand Down

0 comments on commit 07f939e

Please sign in to comment.