Kandrashin Denis 13 anni fa
parent
commit
320d9f3449
5 ha cambiato i file con 22 aggiunte e 1 eliminazioni
  1. 2 0
      source/fb2edit.qrc
  2. 16 0
      source/fb2main.cpp
  3. 4 1
      source/fb2main.h
  4. BIN
      source/images/zoom-in.png
  5. BIN
      source/images/zoom-out.png

+ 2 - 0
source/fb2edit.qrc

@@ -17,5 +17,7 @@
         <file>images/format-text-strikethrough.png</file>
         <file>images/format-text-underline.png</file>
         <file>images/window-close.png</file>
+        <file>images/zoom-out.png</file>
+        <file>images/zoom-in.png</file>
     </qresource>
 </RCC>

+ 16 - 0
source/fb2main.cpp

@@ -332,6 +332,19 @@ void MainWindow::createActions()
 
     menu->addAction(actText);
     menu->addAction(actQsci);
+    menu->addSeparator();
+
+    tool = addToolBar(tr("Zoom"));
+
+    actionZoomIn = act = new QAction(icon("zoom-in"), tr("Zoom in"), this);
+    act->setShortcuts(QKeySequence::ZoomIn);
+    menu->addAction(act);
+    tool->addAction(act);
+
+    actionZoomOut = act = new QAction(icon("zoom-out"), tr("Zoom out"), this);
+    act->setShortcuts(QKeySequence::ZoomOut);
+    menu->addAction(act);
+    tool->addAction(act);
 
     menuBar()->addSeparator();
 
@@ -373,6 +386,9 @@ void MainWindow::createText()
     connect(actionUndo, SIGNAL(triggered()), textEdit, SLOT(undo()));
     connect(actionRedo, SIGNAL(triggered()), textEdit, SLOT(redo()));
 
+    connect(actionZoomIn, SIGNAL(triggered()), textEdit, SLOT(zoomIn()));
+    connect(actionZoomOut, SIGNAL(triggered()), textEdit, SLOT(zoomOut()));
+
     actionUndo->setEnabled(false);
     actionRedo->setEnabled(false);
 

+ 4 - 1
source/fb2main.h

@@ -93,7 +93,10 @@ private:
         *actionTextItalic,
         *actionTextStrike,
         *actionTextSub,
-        *actionTextSup;
+        *actionTextSup,
+        *actionZoomIn,
+        *actionZoomOut
+    ;
 };
 
 #endif // FB2MAIN_H

BIN
source/images/zoom-in.png


BIN
source/images/zoom-out.png