浏览代码

Mode icons: text, head, code

Kandrashin Denis 12 年之前
父节点
当前提交
8071e67c5a

二进制
3rdparty/gnome/16x16/text-x-generic.png


二进制
3rdparty/gnome/16x16/x-office-document.png


二进制
3rdparty/gnome/24x24/text-x-generic.png


二进制
3rdparty/gnome/24x24/x-office-document.png


+ 8 - 4
3rdparty/gnome/gnome.qrc

@@ -15,6 +15,7 @@
         <file>16x16/edit-undo.png</file>
         <file>16x16/format-indent-less.png</file>
         <file>16x16/format-indent-more.png</file>
+        <file>16x16/format-justify-center.png</file>
         <file>16x16/format-text-bold.png</file>
         <file>16x16/format-text-italic.png</file>
         <file>16x16/format-text-strikethrough.png</file>
@@ -29,7 +30,10 @@
         <file>16x16/list-add.png</file>
         <file>16x16/list-remove.png</file>
         <file>16x16/preferences-desktop.png</file>
+        <file>16x16/text-x-generic.png</file>
+        <file>16x16/utilities-terminal.png</file>
         <file>16x16/window-close.png</file>
+        <file>16x16/x-office-document.png</file>
         <file>16x16/zoom-in.png</file>
         <file>16x16/zoom-original.png</file>
         <file>16x16/zoom-out.png</file>
@@ -48,6 +52,7 @@
         <file>24x24/edit-undo.png</file>
         <file>24x24/format-indent-less.png</file>
         <file>24x24/format-indent-more.png</file>
+        <file>24x24/format-justify-center.png</file>
         <file>24x24/format-text-bold.png</file>
         <file>24x24/format-text-italic.png</file>
         <file>24x24/format-text-strikethrough.png</file>
@@ -62,13 +67,12 @@
         <file>24x24/list-add.png</file>
         <file>24x24/list-remove.png</file>
         <file>24x24/preferences-desktop.png</file>
+        <file>24x24/text-x-generic.png</file>
+        <file>24x24/utilities-terminal.png</file>
         <file>24x24/window-close.png</file>
+        <file>24x24/x-office-document.png</file>
         <file>24x24/zoom-in.png</file>
         <file>24x24/zoom-original.png</file>
         <file>24x24/zoom-out.png</file>
-        <file>16x16/format-justify-center.png</file>
-        <file>24x24/format-justify-center.png</file>
-        <file>16x16/utilities-terminal.png</file>
-        <file>24x24/utilities-terminal.png</file>
     </qresource>
 </RCC>

+ 9 - 0
source/fb2dock.cpp

@@ -11,6 +11,15 @@
 //  FbModeAction
 //---------------------------------------------------------------------------
 
+FbModeAction::FbModeAction(FbMainDock *parent, Fb::Mode mode, const QIcon &icon, const QString &text)
+    : QAction(icon, text, parent)
+    , m_dock(parent)
+    , m_mode(mode)
+{
+    setCheckable(true);
+    connect(this, SIGNAL(triggered()), SLOT(switchMode()));
+}
+
 FbModeAction::FbModeAction(FbMainDock *parent, Fb::Mode mode, const QString &text)
     : QAction(text, parent)
     , m_dock(parent)

+ 1 - 0
source/fb2dock.hpp

@@ -59,6 +59,7 @@ class FbModeAction : public QAction
 {
     Q_OBJECT
 public:
+    explicit FbModeAction(FbMainDock *parent, Fb::Mode mode, const QIcon &icon, const QString &text);
     explicit FbModeAction(FbMainDock *parent, Fb::Mode mode, const QString &text);
 
 private slots:

+ 1 - 7
source/fb2head.cpp

@@ -598,6 +598,7 @@ void FbHeadEdit::setAction(Fb::Actions index, QAction *action)
 void FbHeadEdit::connectActions(QToolBar *tool)
 {
     tool->clear();
+    tool->addSeparator();
     tool->addAction(actionInsert);
     tool->addAction(actionDelete);
 }
@@ -612,13 +613,6 @@ FbHeadModel * FbHeadEdit::model() const
     return qobject_cast<FbHeadModel*>(QTreeView::model());
 }
 
-void FbHeadEdit::initToolbar(QToolBar &toolbar)
-{
-    toolbar.addSeparator();
-    toolbar.addAction(actionInsert);
-    toolbar.addAction(actionDelete);
-}
-
 void FbHeadEdit::updateTree()
 {
     FbHeadModel * model = new FbHeadModel(*m_text, this);

+ 0 - 1
source/fb2head.hpp

@@ -175,7 +175,6 @@ class FbHeadEdit : public QTreeView
 
 public:
     explicit FbHeadEdit(QWidget *parent, FbTextEdit *text);
-    void initToolbar(QToolBar &toolbar);
     FbHeadModel * model() const;
 
     void setAction(Fb::Actions index, QAction *action);

+ 4 - 4
source/fb2main.cpp

@@ -411,24 +411,24 @@ void FbMainWindow::createActions()
 
     QActionGroup * viewGroup = new QActionGroup(this);
 
-    act = new FbModeAction(mainDock, Fb::Text, tr("&Text"));
+    act = new FbModeAction(mainDock, Fb::Text, FbIcon("x-office-document"), tr("&Text"));
     viewGroup->addAction(act);
     menu->addAction(act);
     tool->addAction(act);
     act->setChecked(true);
 
-    act = new FbModeAction(mainDock, Fb::Head, tr("&Head"));
+    act = new FbModeAction(mainDock, Fb::Head, FbIcon("document-properties"), tr("&Head"));
     viewGroup->addAction(act);
     menu->addAction(act);
     tool->addAction(act);
 
-    act = new FbModeAction(mainDock, Fb::Code, tr("&XML"));
+    act = new FbModeAction(mainDock, Fb::Code, FbIcon("text-x-generic"), tr("&XML"));
     viewGroup->addAction(act);
     menu->addAction(act);
     tool->addAction(act);
 
 #ifdef QT_DEBUG
-    act = new FbModeAction(mainDock, Fb::Html, tr("&HTML"));
+    act = new FbModeAction(mainDock, Fb::Html, FbIcon("text-html"), tr("&HTML"));
     viewGroup->addAction(act);
     menu->addAction(act);
 #endif // _DEBUG

+ 5 - 3
source/fb2text.cpp

@@ -260,9 +260,11 @@ void FbTextEdit::connectActions(QToolBar *tool)
         }
     }
 
-    connect(act(Fb::ViewContents), SIGNAL(triggered(bool)), this, SLOT(viewContents(bool)));
-    connect(act(Fb::ViewPictures), SIGNAL(triggered(bool)), this, SLOT(viewPictures(bool)));
-    connect(act(Fb::ViewInspector), SIGNAL(triggered(bool)), this, SLOT(viewInspector(bool)));
+    connect(act(Fb::EditFind), SIGNAL(triggered()), SLOT(find()));
+
+    connect(act(Fb::ViewContents), SIGNAL(triggered(bool)), SLOT(viewContents(bool)));
+    connect(act(Fb::ViewPictures), SIGNAL(triggered(bool)), SLOT(viewPictures(bool)));
+    connect(act(Fb::ViewInspector), SIGNAL(triggered(bool)), SLOT(viewInspector(bool)));
 
     connect(act(Fb::ZoomIn), SIGNAL(triggered()), SLOT(zoomIn()));
     connect(act(Fb::ZoomOut), SIGNAL(triggered()), SLOT(zoomOut()));