traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/traverso dialogs/settings/Pages.cp...


From: Nicola Doebelin
Subject: [Traverso-commit] traverso/src/traverso dialogs/settings/Pages.cp...
Date: Wed, 06 Aug 2008 16:47:21 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Nicola Doebelin <n_doebelin>    08/08/06 16:47:21

Modified files:
        src/traverso/dialogs/settings: Pages.cpp Pages.h 
        src/traverso/ui: ThemeConfigPage.ui 
        src/traverso/widgets: TransportConsoleWidget.cpp 
                              TransportConsoleWidget.h 
        src/traverso   : Interface.cpp 

Log message:
        - The style of the tool bars can be changed (size of the icons, 
icon/text combinations)
        - The size of the transport console can be changed
        
        Go to "Preferences -> Appearance -> Toolbars" to check it out. It's 
better to undock the transport console if you make it bigger than the regular 
toolbars.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/settings/Pages.cpp?cvsroot=traverso&r1=1.41&r2=1.42
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/settings/Pages.h?cvsroot=traverso&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ui/ThemeConfigPage.ui?cvsroot=traverso&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/widgets/TransportConsoleWidget.cpp?cvsroot=traverso&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/widgets/TransportConsoleWidget.h?cvsroot=traverso&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/Interface.cpp?cvsroot=traverso&r1=1.150&r2=1.151

Patches:
Index: dialogs/settings/Pages.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/dialogs/settings/Pages.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- dialogs/settings/Pages.cpp  24 May 2008 15:47:13 -0000      1.41
+++ dialogs/settings/Pages.cpp  6 Aug 2008 16:47:20 -0000       1.42
@@ -554,6 +554,11 @@
        
        load_config();
        m_themepage->create_connections();
+
+       #if defined Q_WS_MAC
+               m_themepage->iconSizeCombo->hide();
+               m_themepage->toolbarStyleCombo->hide();
+       #endif
 }
 
 void AppearancePage::save_config()
@@ -566,6 +571,10 @@
        config().set_property("Themer", "paintaudiorectified", 
m_themepage->rectifiedCheckBox->isChecked());
        config().set_property("Themer", "paintstereoaudioasmono", 
m_themepage->mergedCheckBox->isChecked());
        config().set_property("Themer", "paintwavewithoutline", 
m_themepage->paintAudioWithOutlineCheckBox->isChecked());
+       config().set_property("Themer", "iconsize", 
m_themepage->iconSizeCombo->currentText());
+       config().set_property("Themer", "toolbuttonstyle", 
m_themepage->toolbarStyleCombo->currentIndex());
+       config().set_property("Themer", "supportediconsizes", 
supportedIconSizes);
+       config().set_property("Themer", "transportconsolesize", 
m_themepage->transportConsoleCombo->currentText());
 }
 
 void AppearancePage::load_config()
@@ -597,7 +606,6 @@
        bool paintStereoAsMono = config().get_property("Themer", 
"paintstereoaudioasmono", false).toBool();
        bool paintWaveWithLines = config().get_property("Themer", 
"paintwavewithoutline", true).toBool();
 
-
        int index = m_themepage->styleCombo->findText(style);
        m_themepage->styleCombo->setCurrentIndex(index);
        index = m_themepage->themeSelecterCombo->findText(theme);
@@ -609,6 +617,50 @@
        m_themepage->mergedCheckBox->setChecked(paintStereoAsMono);
        
m_themepage->paintAudioWithOutlineCheckBox->setChecked(paintWaveWithLines);
 
+       m_themepage->toolbarStyleCombo->clear();
+       m_themepage->toolbarStyleCombo->addItem(tr("Icons only"));
+       m_themepage->toolbarStyleCombo->addItem(tr("Text only"));
+       m_themepage->toolbarStyleCombo->addItem(tr("Text beside Icons"));
+       m_themepage->toolbarStyleCombo->addItem(tr("Text below Icons"));
+       int tbstyle = config().get_property("Themer", "toolbuttonstyle", 
0).toInt();
+       m_themepage->toolbarStyleCombo->setCurrentIndex(tbstyle);
+
+       // icon sizes of the toolbars
+       QString iconsize = config().get_property("Themer", "iconsize", 
"16").toString();
+       supportedIconSizes = config().get_property("Themer", 
"supportediconsizes", "16;22;32;48").toString();
+
+       // if the list is empty, we should offer some default values. (The list 
can only be 
+       // empty if someone deleted the values, but not the whole entry, in the 
config file.)
+       if (supportedIconSizes.isEmpty()) {
+               supportedIconSizes = "16;22;32;48";
+       }
+
+       QStringList iconSizesList = supportedIconSizes.split(";", 
QString::SkipEmptyParts);
+
+       // check if the current icon size occurs in the list, if not, add it
+       if (iconSizesList.lastIndexOf(iconsize) == -1) {
+               iconSizesList << iconsize;
+               iconSizesList.sort();
+       }
+
+       m_themepage->iconSizeCombo->clear();
+       m_themepage->iconSizeCombo->addItems(iconSizesList);
+       int iconsizeindex = m_themepage->iconSizeCombo->findText(iconsize);
+       m_themepage->iconSizeCombo->setCurrentIndex(iconsizeindex);
+
+       // and the same again for the icons size of the transport console
+       QString trspsize = config().get_property("Themer", 
"transportconsolesize", "16").toString();
+       iconSizesList = supportedIconSizes.split(";", QString::SkipEmptyParts);
+
+       if (iconSizesList.lastIndexOf(iconsize) == -1) {
+               iconSizesList << trspsize;
+               iconSizesList.sort();
+       }
+
+       m_themepage->transportConsoleCombo->clear();
+       m_themepage->transportConsoleCombo->addItems(iconSizesList);
+       int trspsizeindex = m_themepage->iconSizeCombo->findText(trspsize);
+       m_themepage->transportConsoleCombo->setCurrentIndex(trspsizeindex);
 }
 
 void AppearancePage::reset_default_config()
@@ -624,6 +676,9 @@
        config().set_property("Themer", "paintaudiorectified", false);
        config().set_property("Themer", "paintstereoaudioasmono", false);
        config().set_property("Themer", "paintwavewithoutline", true);
+       config().set_property("Themer", "supportediconsizes", "16;22;32;48");
+       config().set_property("Themer", "iconsize", "16");
+       config().set_property("Themer", "toolbuttonstyle", 0);
        
        load_config();
 }

Index: dialogs/settings/Pages.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/dialogs/settings/Pages.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- dialogs/settings/Pages.h    24 Jan 2008 18:06:26 -0000      1.10
+++ dialogs/settings/Pages.h    6 Aug 2008 16:47:21 -0000       1.11
@@ -223,6 +223,7 @@
        void reset_default_config();
 
 private:
+       QString supportedIconSizes;
        ThemeConfigPage* m_themepage;
 };
 

Index: ui/ThemeConfigPage.ui
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/ui/ThemeConfigPage.ui,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- ui/ThemeConfigPage.ui       24 Jan 2008 18:06:26 -0000      1.6
+++ ui/ThemeConfigPage.ui       6 Aug 2008 16:47:21 -0000       1.7
@@ -6,25 +6,23 @@
     <x>0</x>
     <y>0</y>
     <width>346</width>
-    <height>387</height>
+    <height>585</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>0</number>
-   </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2" >
    <property name="spacing" >
     <number>6</number>
    </property>
+   <property name="margin" >
+    <number>0</number>
+   </property>
    <item>
     <widget class="QGroupBox" name="groupBox" >
      <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>5</hsizetype>
-       <vsizetype>5</vsizetype>
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
        <horstretch>1</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
@@ -33,28 +31,28 @@
       <string>Theme selector</string>
      </property>
      <layout class="QVBoxLayout" >
-      <property name="margin" >
-       <number>9</number>
-      </property>
       <property name="spacing" >
        <number>12</number>
       </property>
-      <item>
-       <layout class="QVBoxLayout" >
         <property name="margin" >
-         <number>0</number>
+       <number>9</number>
         </property>
+      <item>
+       <layout class="QVBoxLayout" >
         <property name="spacing" >
          <number>6</number>
         </property>
-        <item>
-         <layout class="QHBoxLayout" >
           <property name="margin" >
            <number>0</number>
           </property>
+        <item>
+         <layout class="QHBoxLayout" >
           <property name="spacing" >
            <number>6</number>
           </property>
+          <property name="margin" >
+           <number>0</number>
+          </property>
           <item>
            <widget class="QLabel" name="label_2" >
             <property name="text" >
@@ -67,7 +65,7 @@
             <property name="orientation" >
              <enum>Qt::Horizontal</enum>
             </property>
-            <property name="sizeHint" >
+            <property name="sizeHint" stdset="0" >
              <size>
               <width>40</width>
               <height>20</height>
@@ -79,21 +77,19 @@
         </item>
         <item>
          <layout class="QHBoxLayout" >
-          <property name="margin" >
-           <number>0</number>
-          </property>
           <property name="spacing" >
            <number>6</number>
           </property>
+          <property name="margin" >
+           <number>0</number>
+          </property>
           <item>
            <widget class="QLineEdit" name="themePathLineEdit" >
             <property name="enabled" >
              <bool>true</bool>
             </property>
             <property name="sizePolicy" >
-             <sizepolicy>
-              <hsizetype>7</hsizetype>
-              <vsizetype>0</vsizetype>
+             <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
               <horstretch>5</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
@@ -122,18 +118,16 @@
       </item>
       <item>
        <layout class="QHBoxLayout" >
-        <property name="margin" >
-         <number>0</number>
-        </property>
         <property name="spacing" >
          <number>6</number>
         </property>
+        <property name="margin" >
+         <number>0</number>
+        </property>
         <item>
          <widget class="QLabel" name="label" >
           <property name="sizePolicy" >
-           <sizepolicy>
-            <hsizetype>5</hsizetype>
-            <vsizetype>5</vsizetype>
+           <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
             <horstretch>1</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
@@ -146,9 +140,7 @@
         <item>
          <widget class="QComboBox" name="themeSelecterCombo" >
           <property name="sizePolicy" >
-           <sizepolicy>
-            <hsizetype>5</hsizetype>
-            <vsizetype>0</vsizetype>
+           <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
             <horstretch>1</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
@@ -166,20 +158,20 @@
       <string>Theme Options</string>
      </property>
      <layout class="QVBoxLayout" >
+      <property name="spacing" >
+       <number>6</number>
+      </property>
       <property name="margin" >
        <number>9</number>
       </property>
+      <item>
+       <layout class="QHBoxLayout" >
       <property name="spacing" >
        <number>6</number>
       </property>
-      <item>
-       <layout class="QHBoxLayout" >
         <property name="margin" >
          <number>0</number>
         </property>
-        <property name="spacing" >
-         <number>6</number>
-        </property>
         <item>
          <widget class="QLabel" name="label_3" >
           <property name="text" >
@@ -236,27 +228,19 @@
      <property name="title" >
       <string>Style Options</string>
      </property>
-     <layout class="QVBoxLayout" >
-      <property name="margin" >
-       <number>9</number>
-      </property>
+     <layout class="QVBoxLayout" name="verticalLayout" >
+      <item>
+       <layout class="QHBoxLayout" >
       <property name="spacing" >
        <number>6</number>
       </property>
-      <item>
-       <layout class="QHBoxLayout" >
         <property name="margin" >
          <number>0</number>
         </property>
-        <property name="spacing" >
-         <number>6</number>
-        </property>
         <item>
          <widget class="QLabel" name="label_4" >
           <property name="sizePolicy" >
-           <sizepolicy>
-            <hsizetype>5</hsizetype>
-            <vsizetype>5</vsizetype>
+           <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
             <horstretch>1</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
@@ -269,9 +253,7 @@
         <item>
          <widget class="QComboBox" name="styleCombo" >
           <property name="sizePolicy" >
-           <sizepolicy>
-            <hsizetype>5</hsizetype>
-            <vsizetype>0</vsizetype>
+           <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
             <horstretch>1</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
@@ -290,6 +272,57 @@
      </layout>
     </widget>
    </item>
+   <item>
+    <widget class="QGroupBox" name="toolbarGroupBox" >
+     <property name="title" >
+      <string>Toolbars</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_3" >
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout" >
+        <item>
+         <widget class="QLabel" name="label_5" >
+          <property name="text" >
+           <string>Icon size</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="iconSizeCombo" />
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3" >
+        <item>
+         <widget class="QLabel" name="label_7" >
+          <property name="text" >
+           <string>Button style</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="toolbarStyleCombo" />
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2" >
+        <item>
+         <widget class="QLabel" name="label_6" >
+          <property name="text" >
+           <string>Size of transport console</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="transportConsoleCombo" />
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
   </layout>
  </widget>
  <resources/>

Index: widgets/TransportConsoleWidget.cpp
===================================================================
RCS file: 
/sources/traverso/traverso/src/traverso/widgets/TransportConsoleWidget.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- widgets/TransportConsoleWidget.cpp  31 Jul 2008 20:37:25 -0000      1.10
+++ widgets/TransportConsoleWidget.cpp  6 Aug 2008 16:47:21 -0000       1.11
@@ -44,7 +44,6 @@
                        "border: 2px solid gray;"
                        "border-radius: 10px;"
                        "padding: 0 8 0 8;"); 
-       m_timeLabel->setMaximumHeight(m_timeLabel->height() - 2);
 
        m_toStartAction = addAction(QIcon(":/skipleft"), tr("Skip to Start"), 
this, SLOT(to_start()));
        m_toLeftAction = addAction(QIcon(":/seekleft"), tr("Previous Snap 
Position"), this, SLOT(to_left()));
@@ -63,6 +62,8 @@
 
        connect(&pm(), SIGNAL(projectLoaded(Project*)), this, 
SLOT(set_project(Project*)));
        connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(update_label()));
+
+       update_layout();
 }
 
 
@@ -211,5 +212,11 @@
        m_timeLabel->setText(currentTime);
 }
 
+void TransportConsoleWidget::update_layout()
+{
+       int iconsize = config().get_property("Themer", "transportconsolesize", 
"16").toInt();
+       setIconSize(QSize(iconsize, iconsize));
+}
+
 //eof
 

Index: widgets/TransportConsoleWidget.h
===================================================================
RCS file: 
/sources/traverso/traverso/src/traverso/widgets/TransportConsoleWidget.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- widgets/TransportConsoleWidget.h    24 May 2008 14:36:14 -0000      1.5
+++ widgets/TransportConsoleWidget.h    6 Aug 2008 16:47:21 -0000       1.6
@@ -72,6 +72,7 @@
        void transfer_stopped();
        void update_recording_state();
        void update_label();
+       void update_layout();
 };
 
 #endif

Index: Interface.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/Interface.cpp,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -b -r1.150 -r1.151
--- Interface.cpp       25 May 2008 20:14:47 -0000      1.150
+++ Interface.cpp       6 Aug 2008 16:47:21 -0000       1.151
@@ -193,6 +193,15 @@
        
                m_editToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
                m_editToolBar->setIconSize(QSize(20, 20));
+       #else
+               if (config().get_property("Themer", "textundericons", 
false).toBool()) {
+                       
m_projectToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
+                       
m_editToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
+               }
+
+               int iconsize = config().get_property("Themer", "iconsize", 
"16").toInt();
+               m_projectToolBar->setIconSize(QSize(iconsize, iconsize));
+               m_editToolBar->setIconSize(QSize(iconsize, iconsize));
        #endif
 
        // Some default values.
@@ -1146,6 +1155,36 @@
                        action->setIcon(QIcon());
                }
        }
+
+       switch (config().get_property("Themer", "toolbuttonstyle", 0).toInt()) {
+               case 0:
+                       
m_projectToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
+                       
m_editToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
+                       break;
+
+               case 1:
+                       
m_projectToolBar->setToolButtonStyle(Qt::ToolButtonTextOnly);
+                       
m_editToolBar->setToolButtonStyle(Qt::ToolButtonTextOnly);
+                       break;
+
+               case 2:
+                       
m_projectToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+                       
m_editToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+                       break;
+
+               case 3:
+                       
m_projectToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
+                       
m_editToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
+                       break;
+       }
+
+       int iconsize = config().get_property("Themer", "iconsize", 
"16").toInt();
+       m_projectToolBar->setIconSize(QSize(iconsize, iconsize));
+       m_editToolBar->setIconSize(QSize(iconsize, iconsize));
+
+       int transportconsolesize = config().get_property("Themer", 
"transportconsolesize", "16").toInt();
+       transportConsole->setIconSize(QSize(transportconsolesize, 
transportconsolesize));
+       transportConsole->resize(transportConsole->sizeHint());
 }
 
 void Interface::import_audio()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]