Michael Gerz wrote:
Jürgen Spitzmüller schrieb:
Michael Gerz wrote:
Any comments on this issues are welcome. I would like to get some
opinions before I change the po file.

remove the shortcuts from the dialog and introduce general shortcuts for the outliner actions.
Abdel,

do you have a suitable patch at hand? IIRC, someone posted an icon-based dialog a couple of days ago.

Here is a slightly modified version of Stefan's patch.

Objections?

Abdel.
Index: lib/images/demote.xpm
===================================================================
--- lib/images/demote.xpm       (revision 0)
+++ lib/images/demote.xpm       (revision 0)
@@ -0,0 +1,31 @@
+/* XPM */
+static char *demote[] = {
+/* columns rows colors chars-per-pixel */
+"20 20 5 1",
+"  c black",
+". c #0000BC",
+"X c blue",
+"o c #C71302",
+"O c None",
+/* pixels */
+"OOOOOOOOOOOOOOOOOOOO",
+"OOOO OOOOOOOOOOOOOOO",
+"OOO  OOOOOOOOOOOOOOO",
+"OOOO OOOO        OOO",
+"OOOO OOOOOOOOOOOOOOO",
+"OOOO OOOOOOOOX.OOOOO",
+"OOOOOOOOOOOOOXX.OOOO",
+"OOOO OOOOOOOOXXX.OOO",
+"OOO O OOXXXXXXXXX.OO",
+"OOOOO OOXXXXXXXXXX.O",
+"OOOO OOOXXXXXXXXX.OO",
+"OOO   OOOOOOOXXX.OOO",
+"OOOOOOOOOOOOOXX.OOOO",
+"OOO  OOOOOOOOX.OOOOO",
+"OOOOO OOOOOOOOOOOOOO",
+"OOOO OOOO        OOO",
+"OOOOO OOOOOOOOOOOOOO",
+"OOO  OOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOO",
+"OOOOOOOOOOOOOOOOOOOO"
+};
Index: lib/images/promote.xpm
===================================================================
--- lib/images/promote.xpm      (revision 0)
+++ lib/images/promote.xpm      (revision 0)
@@ -0,0 +1,30 @@
+/* XPM */
+static char *promote[] = {
+/* columns rows colors chars-per-pixel */
+"20 20 4 1",
+"  c black",
+". c #0000BC",
+"X c blue",
+"o c None",
+/* pixels */
+"oooooooooooooooooooo",
+"oooo ooooooooooooooo",
+"ooo  ooooooooooooooo",
+"oooo oooo        ooo",
+"oooo ooooooooooooooo",
+"oooo o.Xoooooooooooo",
+"ooooo.XXoooooooooooo",
+"oooo.XXXoooooo oooo ",
+"ooo.XXXXXXXXX o oo  ",
+"oo.XXXXXXXXXXoo ooo ",
+"ooo.XXXXXXXXXo oooo ",
+"oooo.XXXooooo   o o ",
+"ooooo.XXoooooooooooo",
+"oooo o.Xoooooooooooo",
+"ooo o oooooooooooooo",
+"ooooo ooo        ooo",
+"oooo ooooooooooooooo",
+"ooo   oooooooooooooo",
+"oooooooooooooooooooo",
+"oooooooooooooooooooo"
+};
Index: lib/images/reload.xpm
===================================================================
--- lib/images/reload.xpm       (revision 0)
+++ lib/images/reload.xpm       (revision 0)
@@ -0,0 +1,28 @@
+/* XPM */
+static char *reload[] = {
+/* columns rows colors chars-per-pixel */
+"16 16 6 1",
+"  c black",
+". c #004000",
+"X c #008000",
+"o c #00C000",
+"O c green",
+"+ c gray100",
+/* pixels */
+"++++++     +++++",
+"++++  Ooo  . +++",
+"+++ OooX ++   ++",
+"+++ ooX +++++ ++",
+"++ OoX +++++++ +",
+"++ ooX +++++++++",
+" OOooooX ++  +++",
+"+ OoooX ++    ++",
+"++ OoX ++      +",
+"+++ X ++        ",
+"++++ +++++    ++",
+"+ ++++++++    ++",
+"++ ++++++    +++",
+"++   ++      +++",
+"+++         ++++",
+"+++++     ++++++"
+};
Index: src/frontends/qt4/TocWidget.cpp
===================================================================
--- src/frontends/qt4/TocWidget.cpp     (revision 18191)
+++ src/frontends/qt4/TocWidget.cpp     (working copy)
@@ -15,6 +15,8 @@
 
 #include "QToc.h"
 #include "qt_helpers.h"
+#include "support/filetools.h"
+#include "support/lstrings.h"
 
 #include "debug.h"
 
@@ -34,9 +36,12 @@
 
 
 namespace lyx {
+
+using support::FileName;
+using support::libFileSearch;
+       
 namespace frontend {
 
-
 TocWidget::TocWidget(QToc * form, QWidget * parent)
        : QWidget(parent), form_(form), depth_(0)
 {
@@ -44,7 +49,18 @@
 
        connect(form, SIGNAL(modelReset()),
                SLOT(updateGui()));
-
+       
+       FileName icon_path = libFileSearch("images", "promote.xpm");
+       moveOutTB->setIcon(QIcon(toqstr(icon_path.absFilename())));
+       icon_path = libFileSearch("images", "demote.xpm");
+       moveInTB->setIcon(QIcon(toqstr(icon_path.absFilename())));
+       icon_path = libFileSearch("images", "up.xpm");
+       moveUpTB->setIcon(QIcon(toqstr(icon_path.absFilename())));
+       icon_path = libFileSearch("images", "down.xpm");
+       moveDownTB->setIcon(QIcon(toqstr(icon_path.absFilename())));
+       icon_path = libFileSearch("images", "reload.xpm");
+       updateTB->setIcon(QIcon(toqstr(icon_path.absFilename())));
+               
        // avoid flickering
        tocTV->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
 
@@ -55,6 +71,9 @@
        // like labels, bookmarks, etc...
        // tocTV->header()->hide();
        tocTV->header()->setVisible(false);
+
+       // Only one item selected at a time.
+       tocTV->setSelectionMode(QAbstractItemView::SingleSelection);
 }
 
 
@@ -70,7 +89,7 @@
 }
 
 
-void TocWidget::on_updatePB_clicked()
+void TocWidget::on_updateTB_clicked()
 {
        form_->updateBackend();
        form_->update();
@@ -127,7 +146,7 @@
 }
 
 
-void TocWidget::on_moveUpPB_clicked()
+void TocWidget::on_moveUpTB_clicked()
 {
        enableControls(false);
        QModelIndexList const & list = 
tocTV->selectionModel()->selectedIndexes();
@@ -140,7 +159,7 @@
 }
 
 
-void TocWidget::on_moveDownPB_clicked()
+void TocWidget::on_moveDownTB_clicked()
 {
        enableControls(false);
        QModelIndexList const & list = 
tocTV->selectionModel()->selectedIndexes();
@@ -153,7 +172,7 @@
 }
 
 
-void TocWidget::on_moveInPB_clicked()
+void TocWidget::on_moveInTB_clicked()
 {
        enableControls(false);
        QModelIndexList const & list = 
tocTV->selectionModel()->selectedIndexes();
@@ -166,7 +185,7 @@
 }
 
 
-void TocWidget::on_moveOutPB_clicked()
+void TocWidget::on_moveOutTB_clicked()
 {
        QModelIndexList const & list = 
tocTV->selectionModel()->selectedIndexes();
        if (!list.isEmpty()) {
@@ -187,6 +206,7 @@
        }
 
        tocTV->selectionModel()->blockSignals(true);
+       tocTV->selectionModel()->clear();
        tocTV->scrollTo(index);
        tocTV->selectionModel()->setCurrentIndex(index,
                QItemSelectionModel::ClearAndSelect);
@@ -196,15 +216,15 @@
 
 void TocWidget::enableControls(bool enable)
 {
-       updatePB->setEnabled(enable);
+       updateTB->setEnabled(enable);
 
        if (!form_->canOutline(typeCO->currentIndex()))
                enable = false;
 
-       moveUpPB->setEnabled(enable);
-       moveDownPB->setEnabled(enable);
-       moveInPB->setEnabled(enable);
-       moveOutPB->setEnabled(enable);
+       moveUpTB->setEnabled(enable);
+       moveDownTB->setEnabled(enable);
+       moveInTB->setEnabled(enable);
+       moveOutTB->setEnabled(enable);
 
        depthSL->setEnabled(enable);
 }
Index: src/frontends/qt4/TocWidget.h
===================================================================
--- src/frontends/qt4/TocWidget.h       (revision 18191)
+++ src/frontends/qt4/TocWidget.h       (working copy)
@@ -41,13 +41,13 @@
        void selectionChanged(const QModelIndex & current,
                const QModelIndex & previous);
 
-       void on_updatePB_clicked();
+       void on_updateTB_clicked();
        void on_depthSL_valueChanged(int depth);
        void on_typeCO_activated(int value);
-       void on_moveUpPB_clicked();
-       void on_moveDownPB_clicked();
-       void on_moveInPB_clicked();
-       void on_moveOutPB_clicked();
+       void on_moveUpTB_clicked();
+       void on_moveDownTB_clicked();
+       void on_moveInTB_clicked();
+       void on_moveOutTB_clicked();
 
 protected:
        ///
Index: src/frontends/qt4/ui/TocUi.ui
===================================================================
--- src/frontends/qt4/ui/TocUi.ui       (revision 18191)
+++ src/frontends/qt4/ui/TocUi.ui       (working copy)
@@ -8,8 +8,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>257</width>
-    <height>404</height>
+    <width>251</width>
+    <height>378</height>
    </rect>
   </property>
   <property name="windowTitle" >
@@ -22,94 +22,125 @@
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="3" column="0" colspan="2" >
-    <layout class="QGridLayout" >
+   <item row="4" column="0" >
+    <layout class="QHBoxLayout" >
      <property name="margin" >
       <number>0</number>
      </property>
      <property name="spacing" >
       <number>6</number>
      </property>
-     <item row="0" column="0" >
-      <widget class="QPushButton" name="moveOutPB" >
+     <item>
+      <widget class="QToolButton" name="updateTB" >
        <property name="toolTip" >
-        <string>Decrease nesting depth of selected item</string>
+        <string>Update navigation tree</string>
        </property>
        <property name="text" >
-        <string>&lt;- P&amp;romote</string>
+        <string>...</string>
        </property>
+       <property name="icon" >
+        <iconset>../../../../lib/images/reload.xpm</iconset>
+       </property>
+       <property name="iconSize" >
+        <size>
+         <width>20</width>
+         <height>20</height>
+        </size>
+       </property>
       </widget>
      </item>
-     <item row="1" column="2" >
-      <widget class="QPushButton" name="moveDownPB" >
+     <item>
+      <spacer>
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" >
+        <size>
+         <width>16</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QToolButton" name="moveOutTB" >
        <property name="toolTip" >
-        <string>Move selected item down by one</string>
+        <string>Decrease nesting depth of selected item</string>
        </property>
        <property name="text" >
-        <string>D&amp;own</string>
+        <string>...</string>
        </property>
+       <property name="icon" >
+        <iconset>../../../../lib/images/promote.xpm</iconset>
+       </property>
+       <property name="iconSize" >
+        <size>
+         <width>20</width>
+         <height>20</height>
+        </size>
+       </property>
       </widget>
      </item>
-     <item row="0" column="1" >
-      <widget class="QPushButton" name="moveInPB" >
+     <item>
+      <widget class="QToolButton" name="moveInTB" >
        <property name="toolTip" >
         <string>Increase nesting depth of selected item</string>
        </property>
        <property name="text" >
-        <string>De&amp;mote -></string>
+        <string>...</string>
        </property>
+       <property name="icon" >
+        <iconset>../../../../lib/images/demote.xpm</iconset>
+       </property>
+       <property name="iconSize" >
+        <size>
+         <width>20</width>
+         <height>20</height>
+        </size>
+       </property>
       </widget>
      </item>
-     <item row="1" column="0" colspan="2" >
-      <widget class="QPushButton" name="updatePB" >
+     <item>
+      <widget class="QToolButton" name="moveDownTB" >
        <property name="toolTip" >
-        <string>Update navigation tree</string>
+        <string>Move selected item down by one</string>
        </property>
        <property name="text" >
-        <string>Upd&amp;ate</string>
+        <string>...</string>
        </property>
+       <property name="icon" >
+        <iconset>../../../../lib/images/down.xpm</iconset>
+       </property>
+       <property name="iconSize" >
+        <size>
+         <width>20</width>
+         <height>20</height>
+        </size>
+       </property>
       </widget>
      </item>
-     <item row="0" column="2" >
-      <widget class="QPushButton" name="moveUpPB" >
+     <item>
+      <widget class="QToolButton" name="moveUpTB" >
        <property name="toolTip" >
         <string>Move selected item up by one</string>
        </property>
        <property name="text" >
-        <string>&amp;Up</string>
+        <string>...</string>
        </property>
+       <property name="icon" >
+        <iconset>../../../../lib/images/up.xpm</iconset>
+       </property>
+       <property name="iconSize" >
+        <size>
+         <width>20</width>
+         <height>20</height>
+        </size>
+       </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item row="0" column="1" >
-    <widget class="QComboBox" name="typeCO" >
-     <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>7</hsizetype>
-       <vsizetype>0</vsizetype>
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="toolTip" >
-      <string>Switch between table of contents, list of figures or list of 
tables, if available</string>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0" colspan="2" >
-    <widget class="QTreeView" name="tocTV" >
-     <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>7</hsizetype>
-       <vsizetype>7</vsizetype>
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="2" >
+   <item row="3" column="0" >
     <widget class="QSlider" name="depthSL" >
      <property name="toolTip" >
       <string>Adjust the depth of the navigation tree</string>
@@ -131,7 +162,19 @@
      </property>
     </widget>
    </item>
-   <item row="0" column="0" >
+   <item row="2" column="0" >
+    <widget class="QTreeView" name="tocTV" >
+     <property name="sizePolicy" >
+      <sizepolicy>
+       <hsizetype>7</hsizetype>
+       <vsizetype>7</vsizetype>
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" >
     <widget class="QLabel" name="typeLA" >
      <property name="text" >
       <string>&amp;Type:</string>
@@ -141,16 +184,27 @@
      </property>
     </widget>
    </item>
+   <item row="0" column="0" >
+    <widget class="QComboBox" name="typeCO" >
+     <property name="sizePolicy" >
+      <sizepolicy>
+       <hsizetype>7</hsizetype>
+       <vsizetype>0</vsizetype>
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="toolTip" >
+      <string>Switch between table of contents, list of figures or list of 
tables, if available</string>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <tabstops>
   <tabstop>typeCO</tabstop>
   <tabstop>tocTV</tabstop>
   <tabstop>depthSL</tabstop>
-  <tabstop>moveUpPB</tabstop>
-  <tabstop>moveDownPB</tabstop>
-  <tabstop>moveInPB</tabstop>
-  <tabstop>moveOutPB</tabstop>
  </tabstops>
  <includes>
   <include location="local" >qt_helpers.h</include>

Reply via email to