1
0
Kandrashin Denis 12 жил өмнө
parent
commit
b73af560cb

BIN
3rdparty/gnome/16x16/format-indent-less.png


BIN
3rdparty/gnome/16x16/format-indent-more.png


BIN
3rdparty/gnome/24x24/format-indent-less.png


BIN
3rdparty/gnome/24x24/format-indent-more.png


+ 66 - 0
3rdparty/gnome/gnome.qrc

@@ -60,5 +60,71 @@
         <file>24x24/zoom-in.png</file>
         <file>24x24/zoom-original.png</file>
         <file>24x24/zoom-out.png</file>
+        <file>16x16/application-exit.png</file>
+        <file>16x16/document-new.png</file>
+        <file>16x16/document-open.png</file>
+        <file>16x16/document-properties.png</file>
+        <file>16x16/document-save.png</file>
+        <file>16x16/edit-clear.png</file>
+        <file>16x16/edit-copy.png</file>
+        <file>16x16/edit-cut.png</file>
+        <file>16x16/edit-find.png</file>
+        <file>16x16/edit-find-replace.png</file>
+        <file>16x16/edit-paste.png</file>
+        <file>16x16/edit-redo.png</file>
+        <file>16x16/edit-undo.png</file>
+        <file>16x16/format-indent-less.png</file>
+        <file>16x16/format-indent-more.png</file>
+        <file>16x16/format-text-bold.png</file>
+        <file>16x16/format-text-italic.png</file>
+        <file>16x16/format-text-strikethrough.png</file>
+        <file>16x16/go-down.png</file>
+        <file>16x16/go-next.png</file>
+        <file>16x16/go-previous.png</file>
+        <file>16x16/go-up.png</file>
+        <file>16x16/insert-image.png</file>
+        <file>16x16/insert-link.png</file>
+        <file>16x16/insert-object.png</file>
+        <file>16x16/insert-text.png</file>
+        <file>16x16/list-add.png</file>
+        <file>16x16/list-remove.png</file>
+        <file>16x16/preferences-desktop.png</file>
+        <file>16x16/window-close.png</file>
+        <file>16x16/zoom-in.png</file>
+        <file>16x16/zoom-original.png</file>
+        <file>16x16/zoom-out.png</file>
+        <file>24x24/application-exit.png</file>
+        <file>24x24/document-new.png</file>
+        <file>24x24/document-open.png</file>
+        <file>24x24/document-properties.png</file>
+        <file>24x24/document-save.png</file>
+        <file>24x24/edit-clear.png</file>
+        <file>24x24/edit-copy.png</file>
+        <file>24x24/edit-cut.png</file>
+        <file>24x24/edit-find.png</file>
+        <file>24x24/edit-find-replace.png</file>
+        <file>24x24/edit-paste.png</file>
+        <file>24x24/edit-redo.png</file>
+        <file>24x24/edit-undo.png</file>
+        <file>24x24/format-indent-less.png</file>
+        <file>24x24/format-indent-more.png</file>
+        <file>24x24/format-text-bold.png</file>
+        <file>24x24/format-text-italic.png</file>
+        <file>24x24/format-text-strikethrough.png</file>
+        <file>24x24/go-down.png</file>
+        <file>24x24/go-next.png</file>
+        <file>24x24/go-previous.png</file>
+        <file>24x24/go-up.png</file>
+        <file>24x24/insert-image.png</file>
+        <file>24x24/insert-link.png</file>
+        <file>24x24/insert-object.png</file>
+        <file>24x24/insert-text.png</file>
+        <file>24x24/list-add.png</file>
+        <file>24x24/list-remove.png</file>
+        <file>24x24/preferences-desktop.png</file>
+        <file>24x24/window-close.png</file>
+        <file>24x24/zoom-in.png</file>
+        <file>24x24/zoom-original.png</file>
+        <file>24x24/zoom-out.png</file>
     </qresource>
 </RCC>

+ 15 - 2
source/fb2main.cpp

@@ -391,7 +391,7 @@ void FbMainWindow::createActions()
 
     menu->addSeparator();
 
-    actionSectSeparator = act = new QAction(tr("Section break"), this);
+    actionSimpleText = act = new QAction(tr("Simple text"), this);
     menu->addAction(act);
 
     actionParaSeparator = act = new QAction(tr("Paragraph"), this);
@@ -434,6 +434,14 @@ void FbMainWindow::createActions()
     menu->addAction(act);
     act->setEnabled(false);
 
+    menu->addSeparator();
+
+    actionSectionAdd = act = new FbTextAction(FbIcon("format-indent-more"), tr("Create section"), QWebPage::ToggleSubscript, this);
+    menu->addAction(act);
+
+    actionSectionDel = act = new FbTextAction(FbIcon("format-indent-less"), tr("Remove section"), QWebPage::ToggleSubscript, this);
+    menu->addAction(act);
+
     menuView = menu = menuBar()->addMenu(tr("&View"));
 
     tool->addSeparator();
@@ -709,10 +717,12 @@ void FbMainWindow::createTextToolbar()
     connect(actionDate, SIGNAL(triggered()), textPage, SLOT(insertDate()));
     connect(actionBody, SIGNAL(triggered()), textPage, SLOT(insertBody()));
 
-    connect(actionSectSeparator, SIGNAL(triggered()), textPage, SLOT(separateSection()));
     connect(actionParaSeparator, SIGNAL(triggered()), textEdit->pageAction(QWebPage::InsertParagraphSeparator), SIGNAL(triggered()));
     connect(actionLineSeparator, SIGNAL(triggered()), textEdit->pageAction(QWebPage::InsertLineSeparator), SIGNAL(triggered()));
 
+    connect(actionSectionAdd, SIGNAL(triggered()), textPage, SLOT(createSection()));
+    connect(actionSectionDel, SIGNAL(triggered()), textPage, SLOT(deleteSection()));
+
     connect(actionZoomIn, SIGNAL(triggered()), textEdit, SLOT(zoomIn()));
     connect(actionZoomOut, SIGNAL(triggered()), textEdit, SLOT(zoomOut()));
     connect(actionZoomReset, SIGNAL(triggered()), textEdit, SLOT(zoomReset()));
@@ -725,7 +735,10 @@ void FbMainWindow::createTextToolbar()
     textEdit->addTools(tool);
 
     tool->addSeparator();
+    tool->addAction(actionSectionAdd);
+    tool->addAction(actionSectionDel);
 
+    tool->addSeparator();
     tool->addAction(actionImage);
     tool->addAction(actionNote);
     tool->addAction(actionLink);

+ 3 - 1
source/fb2main.hpp

@@ -139,7 +139,7 @@ private:
         *actionStanza,
         *actionAuthor,
         *actionSection,
-        *actionSectSeparator,
+        *actionSimpleText,
         *actionParaSeparator,
         *actionLineSeparator,
         *actionClearFormat,
@@ -149,6 +149,8 @@ private:
         *actionTextCode,
         *actionTextSub,
         *actionTextSup,
+        *actionSectionAdd,
+        *actionSectionDel,
         *actionContents,
         *actionPictures,
         *actionInspect,

+ 5 - 1
source/fb2text.cpp

@@ -277,12 +277,16 @@ void FbTextPage::insertDate()
 {
 }
 
-void FbTextPage::separateSection()
+void FbTextPage::createSection()
 {
     static const QString javascript = FB2::read(":/js/new_section.js");
     mainFrame()->evaluateJavaScript(javascript);
 }
 
+void FbTextPage::deleteSection()
+{
+}
+
 FbTextElement FbTextPage::current()
 {
     return element(location());

+ 2 - 1
source/fb2text.hpp

@@ -90,7 +90,8 @@ public slots:
     void insertPoem();
     void insertStanza();
     void insertDate();
-    void separateSection();
+    void createSection();
+    void deleteSection();
 
 protected:
     virtual bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type);