[QGIS Commit] r14913 - in trunk/qgis: images images/themes/default images/themes/default/styleicons src/gui/symbology-ng src/ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Dec 14 17:09:39 EST 2010


Author: wonder
Date: 2010-12-14 14:09:39 -0800 (Tue, 14 Dec 2010)
New Revision: 14913

Added:
   trunk/qgis/images/themes/default/styleicons/
   trunk/qgis/images/themes/default/styleicons/color.png
   trunk/qgis/images/themes/default/styleicons/style-line.png
   trunk/qgis/images/themes/default/styleicons/style-point.png
   trunk/qgis/images/themes/default/styleicons/style-polygon.png
Modified:
   trunk/qgis/images/images.qrc
   trunk/qgis/src/gui/symbology-ng/qgsstylev2managerdialog.cpp
   trunk/qgis/src/ui/qgsstylev2managerdialogbase.ui
Log:
Better style manager dialog with icons from Robert Szczepanek.


Modified: trunk/qgis/images/images.qrc
===================================================================
--- trunk/qgis/images/images.qrc	2010-12-14 20:45:46 UTC (rev 14912)
+++ trunk/qgis/images/images.qrc	2010-12-14 22:09:39 UTC (rev 14913)
@@ -279,6 +279,10 @@
     <file>themes/default/propertyicons/rendering.png</file>
     <file>themes/default/propertyicons/symbology.png</file>
     <file>themes/default/propertyicons/transparency.png</file>
+    <file>themes/default/styleicons/color.png</file>
+    <file>themes/default/styleicons/style-point.png</file>
+    <file>themes/default/styleicons/style-line.png</file>
+    <file>themes/default/styleicons/style-polygon.png</file>
     <file>icons/qgis-icon-16x16.png</file>
     <file>icons/qgis-icon-60x60.png</file>
     <file>themes/gis/mActionAddArrow.png</file>

Added: trunk/qgis/images/themes/default/styleicons/color.png
===================================================================
(Binary files differ)


Property changes on: trunk/qgis/images/themes/default/styleicons/color.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/qgis/images/themes/default/styleicons/style-line.png
===================================================================
(Binary files differ)


Property changes on: trunk/qgis/images/themes/default/styleicons/style-line.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/qgis/images/themes/default/styleicons/style-point.png
===================================================================
(Binary files differ)


Property changes on: trunk/qgis/images/themes/default/styleicons/style-point.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/qgis/images/themes/default/styleicons/style-polygon.png
===================================================================
(Binary files differ)


Property changes on: trunk/qgis/images/themes/default/styleicons/style-polygon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: trunk/qgis/src/gui/symbology-ng/qgsstylev2managerdialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgsstylev2managerdialog.cpp	2010-12-14 20:45:46 UTC (rev 14912)
+++ trunk/qgis/src/gui/symbology-ng/qgsstylev2managerdialog.cpp	2010-12-14 22:09:39 UTC (rev 14913)
@@ -44,7 +44,7 @@
 
   populateTypes();
 
-  connect( cboItemType, SIGNAL( currentIndexChanged( int ) ), this, SLOT( populateList() ) );
+  connect( tabItemType, SIGNAL( currentChanged( int ) ), this, SLOT( populateList() ) );
 
   populateList();
 
@@ -61,8 +61,10 @@
 void QgsStyleV2ManagerDialog::populateTypes()
 {
   // save current selection index in types combo
-  int current = ( cboItemType->count() > 0 ? cboItemType->currentIndex() : 0 );
+  int current = ( tabItemType->count() > 0 ? tabItemType->currentIndex() : 0 );
 
+ // no counting of style items
+/*
   int markerCount = 0, lineCount = 0, fillCount = 0;
 
   QStringList symbolNames = mStyle->symbolNames();
@@ -86,7 +88,7 @@
 
   // update current index to previous selection
   cboItemType->setCurrentIndex( current );
-
+*/
 }
 
 void QgsStyleV2ManagerDialog::populateList()
@@ -154,8 +156,14 @@
 
 int QgsStyleV2ManagerDialog::currentItemType()
 {
-  int idx = cboItemType->currentIndex();
-  return cboItemType->itemData( idx ).toInt();
+  switch ( tabItemType->currentIndex() )
+  {
+    case 0: return QgsSymbolV2::Marker;
+    case 1: return QgsSymbolV2::Line;
+    case 2: return QgsSymbolV2::Fill;
+    case 3: return 3;
+    default: return 0;
+  }
 }
 
 QString QgsStyleV2ManagerDialog::currentItemName()

Modified: trunk/qgis/src/ui/qgsstylev2managerdialogbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsstylev2managerdialogbase.ui	2010-12-14 20:45:46 UTC (rev 14912)
+++ trunk/qgis/src/ui/qgsstylev2managerdialogbase.ui	2010-12-14 22:09:39 UTC (rev 14913)
@@ -6,29 +6,104 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>300</width>
-    <height>369</height>
+    <width>625</width>
+    <height>395</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Style Manager</string>
   </property>
-  <layout class="QVBoxLayout">
+  <layout class="QVBoxLayout" name="verticalLayout">
    <item>
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string>Style item type</string>
+    <widget class="QTabWidget" name="tabItemType">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
      </property>
-     <property name="buddy">
-      <cstring>cboItemType</cstring>
+     <property name="currentIndex">
+      <number>0</number>
      </property>
+     <property name="iconSize">
+      <size>
+       <width>22</width>
+       <height>22</height>
+      </size>
+     </property>
+     <property name="documentMode">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="tabMarker">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Ignored">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <attribute name="icon">
+       <iconset resource="../../images/images.qrc">
+        <normaloff>:/images/themes/default/styleicons/style-point.png</normaloff>:/images/themes/default/styleicons/style-point.png</iconset>
+      </attribute>
+      <attribute name="title">
+       <string>Marker</string>
+      </attribute>
+     </widget>
+     <widget class="QWidget" name="tabLine">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Ignored">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <attribute name="icon">
+       <iconset resource="../../images/images.qrc">
+        <normaloff>:/images/themes/default/styleicons/style-line.png</normaloff>:/images/themes/default/styleicons/style-line.png</iconset>
+      </attribute>
+      <attribute name="title">
+       <string>Line</string>
+      </attribute>
+     </widget>
+     <widget class="QWidget" name="tabFill">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Ignored">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <attribute name="icon">
+       <iconset resource="../../images/images.qrc">
+        <normaloff>:/images/themes/default/styleicons/style-polygon.png</normaloff>:/images/themes/default/styleicons/style-polygon.png</iconset>
+      </attribute>
+      <attribute name="title">
+       <string>Fill</string>
+      </attribute>
+     </widget>
+     <widget class="QWidget" name="tabColorRamp">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Ignored">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <attribute name="icon">
+       <iconset resource="../../images/images.qrc">
+        <normaloff>:/images/themes/default/styleicons/color.png</normaloff>:/images/themes/default/styleicons/color.png</iconset>
+      </attribute>
+      <attribute name="title">
+       <string>Color ramp</string>
+      </attribute>
+     </widget>
     </widget>
    </item>
    <item>
-    <widget class="QComboBox" name="cboItemType"/>
-   </item>
-   <item>
     <widget class="QListView" name="listItems">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>3</verstretch>
+      </sizepolicy>
+     </property>
      <property name="editTriggers">
       <set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
      </property>
@@ -59,6 +134,9 @@
        <property name="toolTip">
         <string>Add item</string>
        </property>
+       <property name="text">
+        <string>Add</string>
+       </property>
       </widget>
      </item>
      <item>
@@ -66,6 +144,9 @@
        <property name="toolTip">
         <string>Edit item</string>
        </property>
+       <property name="text">
+        <string>Edit</string>
+       </property>
       </widget>
      </item>
      <item>
@@ -73,6 +154,9 @@
        <property name="toolTip">
         <string>Remove item</string>
        </property>
+       <property name="text">
+        <string>Remove</string>
+       </property>
       </widget>
      </item>
      <item>
@@ -103,14 +187,15 @@
   </layout>
  </widget>
  <tabstops>
-  <tabstop>cboItemType</tabstop>
   <tabstop>listItems</tabstop>
   <tabstop>btnAddItem</tabstop>
   <tabstop>btnEditItem</tabstop>
   <tabstop>btnRemoveItem</tabstop>
   <tabstop>buttonBox</tabstop>
  </tabstops>
- <resources/>
+ <resources>
+  <include location="../../images/images.qrc"/>
+ </resources>
  <connections>
   <connection>
    <sender>buttonBox</sender>



More information about the QGIS-commit mailing list