From d1ae78c2d20a242c1d7f793ece7b139dc27b18a8 Mon Sep 17 00:00:00 2001 From: Anatoly Mihalchenko Date: Mon, 29 Aug 2011 15:59:26 +0300 Subject: [PATCH] SANKORE-92: Magnifier --- resources/forms/mainWindow.ui | 3401 +++++++++-------- resources/images/stylusPalette/magnifier.png | Bin 0 -> 2759 bytes .../images/stylusPalette/magnifierOn.png | Bin 0 -> 2895 bytes .../images/toolbar/largeMagnifierSize.png | Bin 0 -> 318 bytes .../images/toolbar/largeMagnifierZoom.png | Bin 0 -> 318 bytes .../images/toolbar/mediumMagnifierSize.png | Bin 0 -> 277 bytes .../images/toolbar/mediumMagnifierZoom.png | Bin 0 -> 277 bytes .../images/toolbar/smallMagnifierSize.png | Bin 0 -> 217 bytes .../images/toolbar/smallMagnifierZoom.png | Bin 0 -> 217 bytes resources/sankore.qrc | 8 + src/board/UBBoardController.cpp | 41 + src/board/UBBoardView.cpp | 5 +- src/board/UBDrawingController.cpp | 22 + src/board/UBDrawingController.h | 3 + src/core/UB.h | 21 +- src/core/UBSettings.cpp | 173 +- src/core/UBSettings.h | 24 + src/domain/UBGraphicsScene.cpp | 69 +- src/domain/UBGraphicsScene.h | 7 + src/gui/UBMagnifer.cpp | 155 + src/gui/UBMagnifer.h | 60 + src/gui/UBResources.cpp | 21 +- src/gui/UBResources.h | 1 + src/gui/UBStylusPalette.cpp | 1 + src/gui/gui.pri | 6 +- 25 files changed, 2349 insertions(+), 1669 deletions(-) create mode 100644 resources/images/stylusPalette/magnifier.png create mode 100644 resources/images/stylusPalette/magnifierOn.png create mode 100644 resources/images/toolbar/largeMagnifierSize.png create mode 100644 resources/images/toolbar/largeMagnifierZoom.png create mode 100644 resources/images/toolbar/mediumMagnifierSize.png create mode 100644 resources/images/toolbar/mediumMagnifierZoom.png create mode 100644 resources/images/toolbar/smallMagnifierSize.png create mode 100644 resources/images/toolbar/smallMagnifierZoom.png create mode 100644 src/gui/UBMagnifer.cpp create mode 100644 src/gui/UBMagnifer.h diff --git a/resources/forms/mainWindow.ui b/resources/forms/mainWindow.ui index 14ef49c3..e0b23cad 100644 --- a/resources/forms/mainWindow.ui +++ b/resources/forms/mainWindow.ui @@ -1,1646 +1,1755 @@ - - - MainWindow - - - - 0 - 0 - 1342 - 334 - - - - Uniboard - - - - :/images/uniboard.png:/images/uniboard.png - - - - 32 - 32 - - - - Qt::ToolButtonTextUnderIcon - - - false - - - - - Qt::PreventContextMenu - - - Board - - - false - - - Qt::BottomToolBarArea|Qt::TopToolBarArea - - - - 48 - 32 - - - - false - - - TopToolBarArea - - - false - - - - - - - - - - - - - - - - - - - - - - Qt::PreventContextMenu - - - Web - - - false - - - Qt::BottomToolBarArea|Qt::TopToolBarArea - - - - 48 - 32 - - - - false - - - TopToolBarArea - - - true - - - - - - - - - - - - - - - - - - - - - - Qt::PreventContextMenu - - - Documents - - - false - - - Qt::BottomToolBarArea|Qt::TopToolBarArea - - - - 48 - 32 - - - - false - - - TopToolBarArea - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::PreventContextMenu - - - Tutorial - - - Qt::LeftToRight - - - false - - - Qt::BottomToolBarArea|Qt::TopToolBarArea - - - - 48 - 32 - - - - false - - - TopToolBarArea - - - true - - - - - - - - - true - - - true - - - - :/images/toolbar/stylus.png:/images/toolbar/stylus.png - - - Stylus - - - Stylus - - - Ctrl+T - - - - - true - - - - :/images/toolbar/background.png:/images/toolbar/background.png - - - Backgrounds - - - Change Background - - - - - - :/images/toolbar/undoOn.png:/images/toolbar/undoOn.png - - - Undo - - - Ctrl+Z - - - - - - :/images/toolbar/redoOn.png:/images/toolbar/redoOn.png - - - Redo - - - Ctrl+Y - - - - - - :/images/toolbar/previousPageOn.png:/images/toolbar/previousPageOn.png - - - Previous - - - Previous Page - - - PgUp - - - - - - :/images/toolbar/nextPageOn.png:/images/toolbar/nextPageOn.png - - - Next - - - Next Page - - - PgDown - - - - - false - - - - :/images/toolbar/documents.png:/images/toolbar/documents.png - - - Documents - - - Manage Documents - - - Ctrl+D - - - - - - :/images/toolbar/web.png:/images/toolbar/web.png - - - Web - - - Web Browsing - - - Ctrl+W - - - - - true - - - true - - - - :/images/toolbar/smallPen.png:/images/toolbar/smallPen.png - - - Line - - - Small Line - - - - - true - - - - :/images/toolbar/mediumPen.png:/images/toolbar/mediumPen.png - - - Line - - - Medium Line - - - - - true - - - - :/images/toolbar/largePen.png:/images/toolbar/largePen.png - - - Line - - - Large Line - - - - - - :/images/toolbar/quitOn.png:/images/toolbar/quitOn.png - - - Quit - - - Quit Uniboard - - - Qt::WindowShortcut - - - QAction::NoRole - - - - - true - - - - :/images/toolbar/smallEraser.png:/images/toolbar/smallEraser.png - - - Eraser - - - Smalle Eraser - - - - - true - - - true - - - - :/images/toolbar/mediumEraser.png:/images/toolbar/mediumEraser.png - - - Eraser - - - Medium Eraser - - - - - true - - - - :/images/toolbar/largeEraser.png:/images/toolbar/largeEraser.png - - - Eraser - - - Large Eraser - - - - - - :/images/toolbar/color.png:/images/toolbar/color.png - - - Color - - - Color - - - - - - :/images/toolbar/color.png:/images/toolbar/color.png - - - Color - - - - - - :/images/toolbar/color.png:/images/toolbar/color.png - - - Color - - - - - - :/images/toolbar/color.png:/images/toolbar/color.png - - - Color - - - - - - :/images/toolbar/previousPageOn.png:/images/toolbar/previousPageOn.png - - - Back - - - Previous Page - - - Left - - - - - - :/images/toolbar/nextPageOn.png:/images/toolbar/nextPageOn.png - - - Forward - - - Next Page - - - Right - - - - - - :/images/toolbar/reload.png:/images/toolbar/reload.png - - - Reload - - - Reload Current Page - - - - - - :/images/toolbar/home.png:/images/toolbar/home.png - - - Home - - - Load Home Page - - - - - - :/images/toolbar/bookmarks.png:/images/toolbar/bookmarks.png - - - Bookmarks - - - Show Bookmarks - - - - - - :/images/toolbar/addBookmark.png:/images/toolbar/addBookmark.png - - - Bookmark - - - Add Bookmark - - - - - - :/images/toolbar/board.png:/images/toolbar/board.png - - - Board - - - Display Board - - - Ctrl+B - - - - - true - - - - :/images/toolbar/clearPage.png:/images/toolbar/clearPage.png - - - Erase - - - Erase Content - - - - - - :/images/toolbar/settings.png:/images/toolbar/settings.png - - - Preferences - - - Display Preferences - - - - - true - - - - :/images/toolbar/library.png:/images/toolbar/library.png - - - Library - - - Show Library - - - Ctrl+L - - - - - - :/images/toolbar/menu.png:/images/toolbar/menu.png - - - Sankoré 3.1 - - - Sankore 3.1 - - - - - - :/images/toolbar/display.png:/images/toolbar/display.png - - - Show Desktop - - - Show Computer Desktop - - - Ctrl+Shift+H - - - - - - :/images/stylusPalette/zoomIn.png:/images/stylusPalette/zoomIn.png - - - Bigger - - - Zoom In - - - Ctrl++ - - - - - - :/images/stylusPalette/zoomOut.png:/images/stylusPalette/zoomOut.png - - - Smaller - - - Zoom Out - - - Ctrl+- - - - - - - :/images/toolbar/newFolder.png:/images/toolbar/newFolder.png - - - New Folder - - - Create a New Folder - - - - - - :/images/toolbar/newDocument.png:/images/toolbar/newDocument.png - - - New Document - - - Create a New Document - - - - - - :/images/toolbar/import.png:/images/toolbar/import.png - - - Import - - - Import a Document - - - - - - :/images/toolbar/export.png:/images/toolbar/export.png - - - Export - - - Export a Document - - - - - - :/images/toolbar/open.png:/images/toolbar/open.png - - - Open in Board - - - Open Page in Board - - - Ctrl+O - - - - - - :/images/toolbar/duplicate.png:/images/toolbar/duplicate.png - - - Duplicate - - - Duplicate Selected Content - - - - - - :/images/toolbar/deleteDocument.png:/images/toolbar/deleteDocument.png - - - Delete - - - Delete Selected Content - - - Del - - - - - - :/images/toolbar/addToWorkingDoc.png:/images/toolbar/addToWorkingDoc.png - - - Add to Working Document - - - Add Selected Content to Open Document - - - - - - :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png - - - Add - - - Add Content to Document - - - - - - :/images/toolbar/rename.png:/images/toolbar/rename.png - - - Rename - - - Rename Content - - - QAction::TextHeuristicRole - - - - - - :/images/toolbar/tools.png:/images/toolbar/tools.png - - - Tools - - - Display Tools - - - - - true - - - - :/images/toolbar/tools.png:/images/toolbar/tools.png - - - Tools - - - Display Tools - - - - - true - - - true - - - - :/images/toolbar/display.png:/images/toolbar/display.png - - - Multi Screen - - - - - true - - - - :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png - - - Wide Size (16/9) - - - Wide Size (16/9) - - - Use Document Wide Size (16/9) - - - false - - - - - true - - - - :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png - - - Regular Size (4/3) - - - Regular Size (4/3) - - - Use Document Regular Size (4/3) - - - false - - - - - true - - - false - - - - :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png - - - Custom Size - - - Custom Size - - - Use Custom Document Size - - - false - - - - - - :/images/toolbar/deleteDocument.png:/images/toolbar/deleteDocument.png - - - Stop Loading - - - Stop Loading Web Page - - - - - - :/images/toolbar/cut.png:/images/toolbar/cut.png - - - Cut - - - Qt::ApplicationShortcut - - - - - - :/images/toolbar/copy.png:/images/toolbar/copy.png - - - Copy - - - Qt::ApplicationShortcut - - - - - - :/images/toolbar/paste.png:/images/toolbar/paste.png - - - Paste - - - Qt::ApplicationShortcut - - - QAction::TextHeuristicRole - - - - - - :/images/extraPalette/blackout.png - :/images/extraPalette/blackoutOn.png:/images/extraPalette/blackout.png - - - Sleep - - - Put Presentation to Sleep - - - - - true - - - - :/images/extraPalette/keyboard.png - :/images/extraPalette/keyboardOn.png:/images/extraPalette/keyboard.png - - - Virtual Keyboard - - - Display Virtual Keyboard - - - - - true - - - - :/images/backgroundPalette/background1.svg - :/images/backgroundPalette/background1On.svg:/images/backgroundPalette/background1.svg - - - Plain Light Background - - - Light - - - Plain Light Background - - - - - true - - - - :/images/backgroundPalette/background2.svg - :/images/backgroundPalette/background2On.svg:/images/backgroundPalette/background2.svg - - - Grid Light Background - - - Light - - - Grid Light Background - - - - - true - - - - :/images/backgroundPalette/background3.svg - :/images/backgroundPalette/background3On.svg:/images/backgroundPalette/background3.svg - - - Plain Dark Background - - - Dark - - - Plain Dark Background - - - - - true - - - - :/images/backgroundPalette/background4.svg - :/images/backgroundPalette/background4On.svg:/images/backgroundPalette/background4.svg - - - Grid Dark Background - - - Dark - - - Grid Dark Background - - - - - true - - - - :/images/toolbar/record.png:/images/toolbar/record.png - - - Podcast - - - Record Presentation to Video - - - - - true - - - - :/images/toolbar/record.png - :/images/toolbar/stop.png:/images/toolbar/record.png - - - Record - - - Start Screen Recording - - - - - - :/images/erasePalette/eraseItem.svg:/images/erasePalette/eraseItem.svg - - - Erase Items - - - Erase All Items - - - - - - :/images/erasePalette/eraseAnnotation.svg:/images/erasePalette/eraseAnnotation.svg - - - Erase Annotations - - - Erase All Annotations - - - - - - :/images/erasePalette/eraseAll.svg:/images/erasePalette/eraseAll.svg - - - Clear Page - - - Clear All Elements - - - - - - :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png - - - Add - - - - - true - - - true - - - - :/images/stylusPalette/pen.png - :/images/stylusPalette/penOn.png:/images/stylusPalette/pen.png - - - Pen - - - Annotate Document - - - Ctrl+I - - - - - true - - - - :/images/stylusPalette/eraser.png - :/images/stylusPalette/eraserOn.png:/images/stylusPalette/eraser.png - - - Eraser - - - Erase Annotation - - - Ctrl+E - - - - - true - - - - :/images/stylusPalette/marker.png - :/images/stylusPalette/markerOn.png:/images/stylusPalette/marker.png - - - Marker - - - Highlight - - - Ctrl+M - - - - - true - - - - :/images/stylusPalette/arrow.png - :/images/stylusPalette/arrowOn.png:/images/stylusPalette/arrow.png - - - Selector - - - Select And Modify Objects - - - Ctrl+F - - - - - true - - - - :/images/stylusPalette/hand.png - :/images/stylusPalette/handOn.png:/images/stylusPalette/hand.png - - - Hand - - - Scroll Page - - - - - true - - - - :/images/stylusPalette/zoomIn.png - :/images/stylusPalette/zoomInOn.png:/images/stylusPalette/zoomIn.png - - - Zoom In - - - - - true - - - - :/images/stylusPalette/zoomOut.png - :/images/stylusPalette/zoomOutOn.png:/images/stylusPalette/zoomOut.png - - - Zoom Out - - - - - true - - - - :/images/stylusPalette/laser.png - :/images/stylusPalette/laserOn.png:/images/stylusPalette/laser.png - - - Laser Pointer - - - Virtual Laser Pointer - - - Ctrl+G - - - - - true - - - - :/images/stylusPalette/line.png - :/images/stylusPalette/lineOn.png:/images/stylusPalette/line.png - - - Line - - - Draw Lines - - - Ctrl+J - - - - - true - - - - :/images/stylusPalette/text.png - :/images/stylusPalette/textOn.png:/images/stylusPalette/text.png - - - Text - - - Write Text - - - Ctrl+K - - - - - true - - - - :/images/stylusPalette/captureArea.png - :/images/stylusPalette/captureAreaOn.png:/images/stylusPalette/captureArea.png - - - Capture - - - Capture Part of the Screen - - - - - - :/images/addItemToCurrentPage.svg:/images/addItemToCurrentPage.svg - - - Add To Current Page - - - Add To Current Page - - - Add Item To Current Page - - - - - - :/images/addItemToNewPage.svg:/images/addItemToNewPage.svg - - - Add To New Page - - - Add Item To New Page - - - - - - :/images/addItemToLibrary.svg:/images/addItemToLibrary.svg - - - Add To Library - - - Add Item To Library - - - - - false - - - - :/images/toolbar/newDocument.png:/images/toolbar/newDocument.png - - - Pages - - - Create a New Page - - - - - - :/images/addItemToCurrentPage.svg:/images/addItemToCurrentPage.svg - - - New Page - - - Create a New Page - - - - - - :/images/addItemToNewPage.svg:/images/addItemToNewPage.svg - - - Duplicate Page - - - Duplicate the Current Page - - - - - - :/images/addItemToLibrary.svg:/images/addItemToLibrary.svg - - - Import Page - - - Import an External Page - - - - - true - - - false - - - - :/images/toolbar/pause.png:/images/toolbar/pause.png - - - Pause - - - Pause Podcast Recording - - - - - - :/images/toolbar/settings.png:/images/toolbar/settings.png - - - Podcast Config - - - Configure Podcast Recording - - - - - - :/images/toolbar/addToolToLibrary.png:/images/toolbar/addToolToLibrary.png - - - Flash Trap - - - Trap Flash Content - - - - - true - - - - :/images/extraPalette/webTrap.png - :/images/extraPalette/webTrapEnabled.png:/images/extraPalette/webTrap.png - - - Web Trap - - - Trap Web Content - - - - - - :/images/toolbar/captureArea.png:/images/toolbar/captureArea.png - - - Custom Capture - - - Capture Part of the Screen - - - - - - :/images/toolbar/captureWindow.png:/images/toolbar/captureWindow.png - - - Window Capture - - - Capture a Window - - - - - false - - - - :/images/extraPalette/oEmbed.png:/images/extraPalette/oEmbed.png - - - Embed Web Content - - - Capture Embeddable Web Content - - - - - true - - - - :/images/toolbar/eyeClosed.png - :/images/toolbar/eyeOpened.png:/images/toolbar/eyeClosed.png - - - Show on Display - - - Show Main Screen on Display Screen - - - false - - - QAction::TextHeuristicRole - - - - - true - - - - :/images/toolbar/tools.png:/images/toolbar/tools.png - - - Tools - - - Define Drawing Options - - - - - - :/images/erasePalette/eraseAnnotation.svg:/images/erasePalette/eraseAnnotation.svg - - - Erase Annotations - - - Erase all Annotations - - - - - - :/images/toolbar/addToolToLibrary.png:/images/toolbar/addToolToLibrary.png - - - eduMedia - - - Import eduMedia simulation - - - - - - :/images/toolbar/tutorial.png:/images/toolbar/tutorial.png - - - Tutorial - - - Open the tutorial - - - - - - :/images/toolbar/updates.png:/images/toolbar/updates.png - - - Check Update - - - - - - :/images/toolbar/paraschool.png:/images/toolbar/paraschool.png - - - Sankoré Editor - - - Show Sankore Widgets Editor - - - - - - :/images/toolbar/hide.png:/images/toolbar/hide.png - - - Hide Sankoré - - - Hide Sankoré Application - - - Ctrl+H - - - - - - - - + + + MainWindow + + + + 0 + 0 + 1342 + 334 + + + + Uniboard + + + + :/images/uniboard.png:/images/uniboard.png + + + + 32 + 32 + + + + Qt::ToolButtonTextUnderIcon + + + false + + + + + Qt::PreventContextMenu + + + Board + + + false + + + Qt::BottomToolBarArea|Qt::TopToolBarArea + + + + 48 + 32 + + + + false + + + TopToolBarArea + + + false + + + + + + + + + + + + + + + + + + + + + + Qt::PreventContextMenu + + + Web + + + false + + + Qt::BottomToolBarArea|Qt::TopToolBarArea + + + + 48 + 32 + + + + false + + + TopToolBarArea + + + true + + + + + + + + + + + + + + + + + + + + + + Qt::PreventContextMenu + + + Documents + + + false + + + Qt::BottomToolBarArea|Qt::TopToolBarArea + + + + 48 + 32 + + + + false + + + TopToolBarArea + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + Qt::PreventContextMenu + + + Tutorial + + + Qt::LeftToRight + + + false + + + Qt::BottomToolBarArea|Qt::TopToolBarArea + + + + 48 + 32 + + + + false + + + TopToolBarArea + + + true + + + + + + + + + true + + + true + + + + :/images/toolbar/stylus.png:/images/toolbar/stylus.png + + + Stylus + + + Stylus + + + Ctrl+T + + + + + true + + + + :/images/toolbar/background.png:/images/toolbar/background.png + + + Backgrounds + + + Change Background + + + + + + :/images/toolbar/undoOn.png:/images/toolbar/undoOn.png + + + Undo + + + Ctrl+Z + + + + + + :/images/toolbar/redoOn.png:/images/toolbar/redoOn.png + + + Redo + + + Ctrl+Y + + + + + + :/images/toolbar/previousPageOn.png:/images/toolbar/previousPageOn.png + + + Previous + + + Previous Page + + + PgUp + + + + + + :/images/toolbar/nextPageOn.png:/images/toolbar/nextPageOn.png + + + Next + + + Next Page + + + PgDown + + + + + false + + + + :/images/toolbar/documents.png:/images/toolbar/documents.png + + + Documents + + + Manage Documents + + + Ctrl+D + + + + + + :/images/toolbar/web.png:/images/toolbar/web.png + + + Web + + + Web Browsing + + + Ctrl+W + + + + + true + + + true + + + + :/images/toolbar/smallPen.png:/images/toolbar/smallPen.png + + + Line + + + Small Line + + + + + true + + + + :/images/toolbar/mediumPen.png:/images/toolbar/mediumPen.png + + + Line + + + Medium Line + + + + + true + + + + :/images/toolbar/largePen.png:/images/toolbar/largePen.png + + + Line + + + Large Line + + + + + + :/images/toolbar/quitOn.png:/images/toolbar/quitOn.png + + + Quit + + + Quit Uniboard + + + Qt::WindowShortcut + + + QAction::NoRole + + + + + true + + + + :/images/toolbar/smallEraser.png:/images/toolbar/smallEraser.png + + + Eraser + + + Smalle Eraser + + + + + true + + + true + + + + :/images/toolbar/mediumEraser.png:/images/toolbar/mediumEraser.png + + + Eraser + + + Medium Eraser + + + + + true + + + + :/images/toolbar/largeEraser.png:/images/toolbar/largeEraser.png + + + Eraser + + + Large Eraser + + + + + + :/images/toolbar/color.png:/images/toolbar/color.png + + + Color + + + Color + + + + + + :/images/toolbar/color.png:/images/toolbar/color.png + + + Color + + + + + + :/images/toolbar/color.png:/images/toolbar/color.png + + + Color + + + + + + :/images/toolbar/color.png:/images/toolbar/color.png + + + Color + + + + + + :/images/toolbar/previousPageOn.png:/images/toolbar/previousPageOn.png + + + Back + + + Previous Page + + + Left + + + + + + :/images/toolbar/nextPageOn.png:/images/toolbar/nextPageOn.png + + + Forward + + + Next Page + + + Right + + + + + + :/images/toolbar/reload.png:/images/toolbar/reload.png + + + Reload + + + Reload Current Page + + + + + + :/images/toolbar/home.png:/images/toolbar/home.png + + + Home + + + Load Home Page + + + + + + :/images/toolbar/bookmarks.png:/images/toolbar/bookmarks.png + + + Bookmarks + + + Show Bookmarks + + + + + + :/images/toolbar/addBookmark.png:/images/toolbar/addBookmark.png + + + Bookmark + + + Add Bookmark + + + + + + :/images/toolbar/board.png:/images/toolbar/board.png + + + Board + + + Display Board + + + Ctrl+B + + + + + true + + + + :/images/toolbar/clearPage.png:/images/toolbar/clearPage.png + + + Erase + + + Erase Content + + + + + + :/images/toolbar/settings.png:/images/toolbar/settings.png + + + Preferences + + + Display Preferences + + + + + true + + + + :/images/toolbar/library.png:/images/toolbar/library.png + + + Library + + + Show Library + + + Ctrl+L + + + + + + :/images/toolbar/menu.png:/images/toolbar/menu.png + + + Sankoré 3.1 + + + Sankore 3.1 + + + + + + :/images/toolbar/display.png:/images/toolbar/display.png + + + Show Desktop + + + Show Computer Desktop + + + Ctrl+Shift+H + + + + + + :/images/stylusPalette/zoomIn.png:/images/stylusPalette/zoomIn.png + + + Bigger + + + Zoom In + + + Ctrl++ + + + + + + :/images/stylusPalette/zoomOut.png:/images/stylusPalette/zoomOut.png + + + Smaller + + + Zoom Out + + + Ctrl+- + + + + + + :/images/toolbar/newFolder.png:/images/toolbar/newFolder.png + + + New Folder + + + Create a New Folder + + + + + + :/images/toolbar/newDocument.png:/images/toolbar/newDocument.png + + + New Document + + + Create a New Document + + + + + + :/images/toolbar/import.png:/images/toolbar/import.png + + + Import + + + Import a Document + + + + + + :/images/toolbar/export.png:/images/toolbar/export.png + + + Export + + + Export a Document + + + + + + :/images/toolbar/open.png:/images/toolbar/open.png + + + Open in Board + + + Open Page in Board + + + Ctrl+O + + + + + + :/images/toolbar/duplicate.png:/images/toolbar/duplicate.png + + + Duplicate + + + Duplicate Selected Content + + + + + + :/images/toolbar/deleteDocument.png:/images/toolbar/deleteDocument.png + + + Delete + + + Delete Selected Content + + + Del + + + + + + :/images/toolbar/addToWorkingDoc.png:/images/toolbar/addToWorkingDoc.png + + + Add to Working Document + + + Add Selected Content to Open Document + + + + + + :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png + + + Add + + + Add Content to Document + + + + + + :/images/toolbar/rename.png:/images/toolbar/rename.png + + + Rename + + + Rename Content + + + QAction::TextHeuristicRole + + + + + + :/images/toolbar/tools.png:/images/toolbar/tools.png + + + Tools + + + Display Tools + + + + + true + + + + :/images/toolbar/tools.png:/images/toolbar/tools.png + + + Tools + + + Display Tools + + + + + true + + + true + + + + :/images/toolbar/display.png:/images/toolbar/display.png + + + Multi Screen + + + + + true + + + + :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png + + + Wide Size (16/9) + + + Wide Size (16/9) + + + Use Document Wide Size (16/9) + + + false + + + + + true + + + + :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png + + + Regular Size (4/3) + + + Regular Size (4/3) + + + Use Document Regular Size (4/3) + + + false + + + + + true + + + false + + + + :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png + + + Custom Size + + + Custom Size + + + Use Custom Document Size + + + false + + + + + + :/images/toolbar/deleteDocument.png:/images/toolbar/deleteDocument.png + + + Stop Loading + + + Stop Loading Web Page + + + + + + :/images/toolbar/cut.png:/images/toolbar/cut.png + + + Cut + + + Qt::ApplicationShortcut + + + + + + :/images/toolbar/copy.png:/images/toolbar/copy.png + + + Copy + + + Qt::ApplicationShortcut + + + + + + :/images/toolbar/paste.png:/images/toolbar/paste.png + + + Paste + + + Qt::ApplicationShortcut + + + QAction::TextHeuristicRole + + + + + + :/images/extraPalette/blackout.png + :/images/extraPalette/blackoutOn.png:/images/extraPalette/blackout.png + + + Sleep + + + Put Presentation to Sleep + + + + + true + + + + :/images/extraPalette/keyboard.png + :/images/extraPalette/keyboardOn.png:/images/extraPalette/keyboard.png + + + Virtual Keyboard + + + Display Virtual Keyboard + + + + + true + + + + :/images/backgroundPalette/background1.svg + :/images/backgroundPalette/background1On.svg:/images/backgroundPalette/background1.svg + + + Plain Light Background + + + Light + + + Plain Light Background + + + + + true + + + + :/images/backgroundPalette/background2.svg + :/images/backgroundPalette/background2On.svg:/images/backgroundPalette/background2.svg + + + Grid Light Background + + + Light + + + Grid Light Background + + + + + true + + + + :/images/backgroundPalette/background3.svg + :/images/backgroundPalette/background3On.svg:/images/backgroundPalette/background3.svg + + + Plain Dark Background + + + Dark + + + Plain Dark Background + + + + + true + + + + :/images/backgroundPalette/background4.svg + :/images/backgroundPalette/background4On.svg:/images/backgroundPalette/background4.svg + + + Grid Dark Background + + + Dark + + + Grid Dark Background + + + + + true + + + + :/images/toolbar/record.png:/images/toolbar/record.png + + + Podcast + + + Record Presentation to Video + + + + + true + + + + :/images/toolbar/record.png + :/images/toolbar/stop.png:/images/toolbar/record.png + + + Record + + + Start Screen Recording + + + + + + :/images/erasePalette/eraseItem.svg:/images/erasePalette/eraseItem.svg + + + Erase Items + + + Erase All Items + + + + + + :/images/erasePalette/eraseAnnotation.svg:/images/erasePalette/eraseAnnotation.svg + + + Erase Annotations + + + Erase All Annotations + + + + + + :/images/erasePalette/eraseAll.svg:/images/erasePalette/eraseAll.svg + + + Clear Page + + + Clear All Elements + + + + + + :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png + + + Add + + + + + true + + + true + + + + :/images/stylusPalette/pen.png + :/images/stylusPalette/penOn.png:/images/stylusPalette/pen.png + + + Pen + + + Annotate Document + + + Ctrl+I + + + + + true + + + + :/images/stylusPalette/eraser.png + :/images/stylusPalette/eraserOn.png:/images/stylusPalette/eraser.png + + + Eraser + + + Erase Annotation + + + Ctrl+E + + + + + true + + + + :/images/stylusPalette/marker.png + :/images/stylusPalette/markerOn.png:/images/stylusPalette/marker.png + + + Marker + + + Highlight + + + Ctrl+M + + + + + true + + + + :/images/stylusPalette/arrow.png + :/images/stylusPalette/arrowOn.png:/images/stylusPalette/arrow.png + + + Selector + + + Select And Modify Objects + + + Ctrl+F + + + + + true + + + + :/images/stylusPalette/hand.png + :/images/stylusPalette/handOn.png:/images/stylusPalette/hand.png + + + Hand + + + Scroll Page + + + + + true + + + + :/images/stylusPalette/zoomIn.png + :/images/stylusPalette/zoomInOn.png:/images/stylusPalette/zoomIn.png + + + Zoom In + + + + + true + + + + :/images/stylusPalette/zoomOut.png + :/images/stylusPalette/zoomOutOn.png:/images/stylusPalette/zoomOut.png + + + Zoom Out + + + + + true + + + + :/images/stylusPalette/laser.png + :/images/stylusPalette/laserOn.png:/images/stylusPalette/laser.png + + + Laser Pointer + + + Virtual Laser Pointer + + + Ctrl+G + + + + + true + + + + :/images/stylusPalette/line.png + :/images/stylusPalette/lineOn.png:/images/stylusPalette/line.png + + + Line + + + Draw Lines + + + Ctrl+J + + + + + true + + + + :/images/stylusPalette/text.png + :/images/stylusPalette/textOn.png:/images/stylusPalette/text.png + + + Text + + + Write Text + + + Ctrl+K + + + + + true + + + + :/images/stylusPalette/captureArea.png + :/images/stylusPalette/captureAreaOn.png:/images/stylusPalette/captureArea.png + + + Capture + + + Capture Part of the Screen + + + + + + :/images/addItemToCurrentPage.svg:/images/addItemToCurrentPage.svg + + + Add To Current Page + + + Add To Current Page + + + Add Item To Current Page + + + + + + :/images/addItemToNewPage.svg:/images/addItemToNewPage.svg + + + Add To New Page + + + Add Item To New Page + + + + + + :/images/addItemToLibrary.svg:/images/addItemToLibrary.svg + + + Add To Library + + + Add Item To Library + + + + + false + + + + :/images/toolbar/newDocument.png:/images/toolbar/newDocument.png + + + Pages + + + Create a New Page + + + + + + :/images/addItemToCurrentPage.svg:/images/addItemToCurrentPage.svg + + + New Page + + + Create a New Page + + + + + + :/images/addItemToNewPage.svg:/images/addItemToNewPage.svg + + + Duplicate Page + + + Duplicate the Current Page + + + + + + :/images/addItemToLibrary.svg:/images/addItemToLibrary.svg + + + Import Page + + + Import an External Page + + + + + true + + + false + + + + :/images/toolbar/pause.png:/images/toolbar/pause.png + + + Pause + + + Pause Podcast Recording + + + + + + :/images/toolbar/settings.png:/images/toolbar/settings.png + + + Podcast Config + + + Configure Podcast Recording + + + + + + :/images/toolbar/addToolToLibrary.png:/images/toolbar/addToolToLibrary.png + + + Flash Trap + + + Trap Flash Content + + + + + true + + + + :/images/extraPalette/webTrap.png + :/images/extraPalette/webTrapEnabled.png:/images/extraPalette/webTrap.png + + + Web Trap + + + Trap Web Content + + + + + + :/images/toolbar/captureArea.png:/images/toolbar/captureArea.png + + + Custom Capture + + + Capture Part of the Screen + + + + + + :/images/toolbar/captureWindow.png:/images/toolbar/captureWindow.png + + + Window Capture + + + Capture a Window + + + + + false + + + + :/images/extraPalette/oEmbed.png:/images/extraPalette/oEmbed.png + + + Embed Web Content + + + Capture Embeddable Web Content + + + + + true + + + + :/images/toolbar/eyeClosed.png + :/images/toolbar/eyeOpened.png:/images/toolbar/eyeClosed.png + + + Show on Display + + + Show Main Screen on Display Screen + + + false + + + QAction::TextHeuristicRole + + + + + true + + + + :/images/toolbar/tools.png:/images/toolbar/tools.png + + + Tools + + + Define Drawing Options + + + + + + :/images/erasePalette/eraseAnnotation.svg:/images/erasePalette/eraseAnnotation.svg + + + Erase Annotations + + + Erase all Annotations + + + + + + :/images/toolbar/addToolToLibrary.png:/images/toolbar/addToolToLibrary.png + + + eduMedia + + + Import eduMedia simulation + + + + + + :/images/toolbar/tutorial.png:/images/toolbar/tutorial.png + + + Tutorial + + + Open the tutorial + + + + + + :/images/toolbar/updates.png:/images/toolbar/updates.png + + + Check Update + + + + + + :/images/toolbar/paraschool.png:/images/toolbar/paraschool.png + + + Sankoré Editor + + + Show Sankore Widgets Editor + + + + + + :/images/toolbar/hide.png:/images/toolbar/hide.png + + + Hide Sankoré + + + Hide Sankoré Application + + + Ctrl+H + + + + + true + + + + :/images/stylusPalette/magnifier.png + :/images/stylusPalette/magnifierOn.png:/images/stylusPalette/magnifier.png + + + Magnifier + + + Magnifier + + + + + true + + + + :/images/toolbar/smallMagnifierZoom.png:/images/toolbar/smallMagnifierZoom.png + + + Zoom + + + x2 Zoom + + + + + true + + + true + + + + :/images/toolbar/mediumMagnifierZoom.png:/images/toolbar/mediumMagnifierZoom.png + + + Zoom + + + x3 Zoom + + + + + true + + + + :/images/toolbar/largeMagnifierZoom.png:/images/toolbar/largeMagnifierZoom.png + + + Zoom + + + x4 Zoom + + + + + true + + + + :/images/toolbar/smallMagnifierSize.png:/images/toolbar/smallMagnifierSize.png + + + Size + + + 10% from scene size + + + + + true + + + + :/images/toolbar/mediumMagnifierSize.png:/images/toolbar/mediumMagnifierSize.png + + + Size + + + 20% from scene size + + + + + true + + + + :/images/toolbar/largeMagnifierSize.png:/images/toolbar/largeMagnifierSize.png + + + Size + + + 30% from scene size + + + + + + + + diff --git a/resources/images/stylusPalette/magnifier.png b/resources/images/stylusPalette/magnifier.png new file mode 100644 index 0000000000000000000000000000000000000000..2690747b463b84be5869d0313d5f6d8b47a90a3f GIT binary patch literal 2759 zcmV;&3OMzNP)KLZ*U+y>?mSmCzdG$c{P%@9}Uh)Wgcsnx?q#^quc}^L^hp!whuWr6ABL2}^!t zoLpAU73XEob5b0omkhlnHw;D#g=v6N5NP&>1#h2X0c;JuC%<3xmP2<5tOJnxv#dfF zy8Z_0)w$w42o0oHq96kC6OcABe*;J_#P}|dHZ#r`hzGz2ZeSu1KLaCftyG3?0Ss0X zH46#6q#JI_&xb&t@@LNh{gC=mg%d4ot(QyVQ@}7-zm?Va1TYBJ-HLZ=5*PqpRLrT_ z7+ars(d0~wQ|Eo1pKjqJ{zCq2OH%|<*4fn$m(NY?^52zC7k~^{&SHJa0S-axDXK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RSz$?zR@v(kTD{ N002ovPDHLkV1m!TEgt{? literal 0 HcmV?d00001 diff --git a/resources/images/stylusPalette/magnifierOn.png b/resources/images/stylusPalette/magnifierOn.png new file mode 100644 index 0000000000000000000000000000000000000000..038960371a1ff9ac157a7145f876c789f54d743a GIT binary patch literal 2895 zcmV-V3$XNwP)*)g8ybXZOA~_ueFHLXt}~Z$d%{OcMe~LO?|w743A!sblR_ zJBrGT)lNssG!r5yL77(DX>Gw*t)kPJ4ni9&h(?lL0!5yR2}D2w33(9my19?tyRXwf zI7^qE8wjYK>CSxT?&Iw4XMewQe&=_7mrzRa|FAi};r-bFz7Jp)fII+Y0C;vy2haha z8^GrP{sEx(dS67Y!=kAG9s_U}fKqmj0x;OG`9Q+Nv0nf<4qyj>Hvx=&SD;=7_!QeW z0BFo|`c*)ACI>r?0(g}HN54(br2y6f$Y4+^lO5Es-Nz*Wbu#e)1_9Iq`0$&8@&KM= zmZSg_CM&3Bft(1GV~|!*7ZYKYUBf>3nn67PHUhYVJs{rQ(~pln+2h-P@XO@$7ls70 zVUi#yWu=8fixyV(E~=R`JPC`sEON7J9|L$2fP5{WJbKMShM!*k(2>%Tf=Gfs>SVB1P!EH3FxW>E zS#~1O=b5{;^Mk|M>UDq0?CBXunpSjEWcG}kq_i876^Fy20njO>x~i%)5{Z&yC;Gg{ zPV`KH0kZt@2lm`?+k%0sxZcg=VREo;&@dU$`mU+{d|)}AB9;-0z{%RZVvclO8xgUM~P zsKEAl)&-ib1eyw9FMt#P()w5aEVl06f5YvID@W&iZ@QG8o-T``C~w-d$=BN2>ZOz# zhGEc!3l|P8TehrkWMstA+uN(1?&=Y?Hy^HaIvm-y#lqApupouIhFoggtu*O=> zX3Z50Ryo_OPYZ{u5kE3rfi1wcH(e%#h3m9ZcZXcmAUvyQC% z{li^;Rn^GC`7`D0>})ABGgI<e{Ae1YBo6;FeR-(E7VdfGUfO_a~hd*PAC>2l3kENxh#W!x;=x=Ur z4j6`^8-`(Mx&aUk&<&`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/largeMagnifierSize.png new file mode 100644 index 0000000000000000000000000000000000000000..d5d6ea2e5089510b49670560a6cafa6b2c55f218 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^{2 zLr%ZSKIx9@3?E|@{&5SZI0Y@>K4RWbVKmE4pn&z!OotlIj?fFH(hMIx6~a;u@Na4O z!E=T|ZAI{PMniSx!Up+O^CXv8PUeul$atcAqr%yTJWm=6)K=7=WMuPE`5`LH(P&by z9{kyQ!n4gOS$5o)_RR1(%k3~roZ+KyP%i7EuL@`PH{6ha!mebxkKvI*fKf;vb#cW%0{V@? M)78&qol`;+0KU;~k^lez literal 0 HcmV?d00001 diff --git a/resources/images/toolbar/largeMagnifierZoom.png b/resources/images/toolbar/largeMagnifierZoom.png new file mode 100644 index 0000000000000000000000000000000000000000..d5d6ea2e5089510b49670560a6cafa6b2c55f218 GIT binary patch literal 318 zcmeAS@N?(olHy`uVBq!ia0vp^{2 zLr%ZSKIx9@3?E|@{&5SZI0Y@>K4RWbVKmE4pn&z!OotlIj?fFH(hMIx6~a;u@Na4O z!E=T|ZAI{PMniSx!Up+O^CXv8PUeul$atcAqr%yTJWm=6)K=7=WMuPE`5`LH(P&by z9{kyQ!n4gOS$5o)_RR1(%k3~roZ+KyP%i7EuL@`PH{6ha!mebxkKvI*fKf;vb#cW%0{V@? M)78&qol`;+0KU;~k^lez literal 0 HcmV?d00001 diff --git a/resources/images/toolbar/mediumMagnifierSize.png b/resources/images/toolbar/mediumMagnifierSize.png new file mode 100644 index 0000000000000000000000000000000000000000..b3b1950dad3a4de45bf3f14f9b53b074fe50925c GIT binary patch literal 277 zcmeAS@N?(olHy`uVBq!ia0vp^{2d=jq6G;3*LCfm=avW#c_KU!8>F`m8rF*A?p z(Pj%1IhIFuHM8m&H;M{`Gks)TaYIud=jq6G;3*LCfm=avW#c_KU!8>F`m8rF*A?p z(Pj%1IhIFuHM8m&H;M{`Gks)TaYIunUPU9@*|Y2yzYfo7-ADgvt~EUIJ`kaoD4=CG$D;_MuUHLYrCK5L%6 zcc@|XePf|{j*s%nUPU9@*|Y2yzYfo7-ADgvt~EUIJ`kaoD4=CG$D;_MuUHLYrCK5L%6 zcc@|XePf|{j*s%images/toolbar/eraserTool.png images/toolbar/lineTool.png images/toolbar/tools.png + images/toolbar/largeMagnifierSize.png + images/toolbar/mediumMagnifierSize.png + images/toolbar/smallMagnifierSize.png + images/toolbar/largeMagnifierZoom.png + images/toolbar/mediumMagnifierZoom.png + images/toolbar/smallMagnifierZoom.png images/stylusPalette/arrow.png images/stylusPalette/arrowOn.png images/stylusPalette/eraser.png @@ -144,6 +150,8 @@ images/stylusPalette/textOn.png images/stylusPalette/captureArea.png images/stylusPalette/captureAreaOn.png + images/stylusPalette/magnifier.png + images/stylusPalette/magnifierOn.png images/backgroundPalette/background1.svg images/backgroundPalette/background1On.svg images/backgroundPalette/background2.svg diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 97e7bdb8..712e1e0d 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -289,7 +289,9 @@ void UBBoardController::setupToolbar() mMainWindow->boardToolBar->insertWidget(mMainWindow->actionBackgrounds, lineWidthChoice); + //-----------------------------------------------------------// // Setup eraser width choice widget + QList eraserWidthActions; eraserWidthActions.append(mMainWindow->actionEraserSmall); eraserWidthActions.append(mMainWindow->actionEraserMedium); @@ -307,6 +309,45 @@ void UBBoardController::setupToolbar() eraserWidthChoice->setCurrentIndex(settings->eraserWidthIndex()); mMainWindow->boardToolBar->insertSeparator(mMainWindow->actionBackgrounds); + + //-----------------------------------------------------------// + + QList magnifierZoomActions; + magnifierZoomActions.append(mMainWindow->actionMagnifierZoomSmall); + magnifierZoomActions.append(mMainWindow->actionMagnifierZoomMedium); + magnifierZoomActions.append(mMainWindow->actionMagnifierZoomLarge); + + UBToolbarButtonGroup *magnifierZoomChoice = + new UBToolbarButtonGroup(mMainWindow->boardToolBar, magnifierZoomActions); + + mMainWindow->boardToolBar->insertWidget(mMainWindow->actionBackgrounds, magnifierZoomChoice); + + connect(settings->appToolBarDisplayText, SIGNAL(changed(QVariant)), magnifierZoomChoice, SLOT(displayText(QVariant))); + connect(magnifierZoomChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setMagnifierZoomIndex(int))); + + magnifierZoomChoice->displayText(QVariant(settings->appToolBarDisplayText->get().toBool())); + magnifierZoomChoice->setCurrentIndex(settings->magnifierZoomIndex()); + + QList magnifierSizeActions; + magnifierSizeActions.append(mMainWindow->actionMagnifierSizeSmall); + magnifierSizeActions.append(mMainWindow->actionMagnifierSizeMedium); + magnifierSizeActions.append(mMainWindow->actionMagnifierSizeLarge); + + UBToolbarButtonGroup *magnifierSizeChoice = + new UBToolbarButtonGroup(mMainWindow->boardToolBar, magnifierSizeActions); + + mMainWindow->boardToolBar->insertWidget(mMainWindow->actionBackgrounds, magnifierSizeChoice); + + connect(settings->appToolBarDisplayText, SIGNAL(changed(QVariant)), magnifierSizeChoice, SLOT(displayText(QVariant))); + connect(magnifierSizeChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setMagnifierSizeIndex(int))); + + magnifierSizeChoice->displayText(QVariant(settings->appToolBarDisplayText->get().toBool())); + magnifierSizeChoice->setCurrentIndex(settings->magnifierSizeIndex()); + + mMainWindow->boardToolBar->insertSeparator(mMainWindow->actionBackgrounds); + + //-----------------------------------------------------------// + UBApplication::app()->insertSpaceToToolbarBeforeAction(mMainWindow->boardToolBar, mMainWindow->actionBoard); UBApplication::app()->insertSpaceToToolbarBeforeAction(mMainWindow->tutorialToolBar, mMainWindow->actionBoard); diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 7e9a256b..d38df42c 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -855,7 +855,10 @@ UBBoardView::setToolCursor (int tool) controlViewport->setCursor (UBResources::resources ()->penCursor); break; case UBStylusTool::Eraser: - controlViewport->setCursor (UBResources::resources ()->eraserCursor); + controlViewport->setCursor (UBResources::resources ()->eraserCursor); + break; + case UBStylusTool::Magnifier: + controlViewport->setCursor (UBResources::resources ()->magnifierCursor); break; case UBStylusTool::Marker: controlViewport->setCursor (UBResources::resources ()->markerCursor); diff --git a/src/board/UBDrawingController.cpp b/src/board/UBDrawingController.cpp index 9cf9233b..61196338 100644 --- a/src/board/UBDrawingController.cpp +++ b/src/board/UBDrawingController.cpp @@ -44,6 +44,7 @@ UBDrawingController::UBDrawingController(QObject * parent) connect(UBApplication::mainWindow->actionPen, SIGNAL(triggered(bool)), this, SLOT(penToolSelected(bool))); connect(UBApplication::mainWindow->actionEraser, SIGNAL(triggered(bool)), this, SLOT(eraserToolSelected(bool))); + connect(UBApplication::mainWindow->actionMagnifier, SIGNAL(triggered(bool)), this, SLOT(magnifierToolSelected(bool))); connect(UBApplication::mainWindow->actionMarker, SIGNAL(triggered(bool)), this, SLOT(markerToolSelected(bool))); connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered(bool)), this, SLOT(selectorToolSelected(bool))); connect(UBApplication::mainWindow->actionHand, SIGNAL(triggered(bool)), this, SLOT(handToolSelected(bool))); @@ -102,6 +103,8 @@ void UBDrawingController::setStylusTool(int tool) UBApplication::mainWindow->actionPen->setChecked(true); else if (mStylusTool == UBStylusTool::Eraser) UBApplication::mainWindow->actionEraser->setChecked(true); + else if (mStylusTool == UBStylusTool::Magnifier) + UBApplication::mainWindow->actionMagnifier->setChecked(true); else if (mStylusTool == UBStylusTool::Marker) UBApplication::mainWindow->actionMarker->setChecked(true); else if (mStylusTool == UBStylusTool::Selector) @@ -263,6 +266,20 @@ void UBDrawingController::setEraserWidthIndex(int index) } +void UBDrawingController::setMagnifierZoomIndex(int index) +{ + setStylusTool(UBStylusTool::Magnifier); + UBSettings::settings()->setMagnifierZoomIndex(index); +} + + +void UBDrawingController::setMagnifierSizeIndex(int index) +{ + setStylusTool(UBStylusTool::Magnifier); + UBSettings::settings()->setMagnifierSizeIndex(index); +} + + void UBDrawingController::setPenColor(bool onDarkBackground, const QColor& color, int pIndex) { if (onDarkBackground) @@ -323,6 +340,11 @@ void UBDrawingController::eraserToolSelected(bool checked) setStylusTool(UBStylusTool::Eraser); } +void UBDrawingController::magnifierToolSelected(bool checked) +{ + if (checked) + setStylusTool(UBStylusTool::Magnifier); +} void UBDrawingController::markerToolSelected(bool checked) { diff --git a/src/board/UBDrawingController.h b/src/board/UBDrawingController.h index 2f6e8f3e..2e4e4394 100644 --- a/src/board/UBDrawingController.h +++ b/src/board/UBDrawingController.h @@ -57,6 +57,8 @@ class UBDrawingController : public QObject void setLineWidthIndex(int index); void setColorIndex(int index); void setEraserWidthIndex(int index); + void setMagnifierZoomIndex(int index); + void setMagnifierSizeIndex(int index); signals: void stylusToolChanged(int tool); @@ -75,6 +77,7 @@ class UBDrawingController : public QObject void penToolSelected(bool checked); void eraserToolSelected(bool checked); + void magnifierToolSelected(bool checked); void markerToolSelected(bool checked); void selectorToolSelected(bool checked); void handToolSelected(bool checked); diff --git a/src/core/UB.h b/src/core/UB.h index bf989b2e..72fed56e 100644 --- a/src/core/UB.h +++ b/src/core/UB.h @@ -26,6 +26,7 @@ struct UBStylusTool { Pen = 0, Eraser, + Magnifier, Marker, Selector, Hand, @@ -46,6 +47,23 @@ struct UBWidth }; }; +struct UBZoom +{ + enum Enum + { + Small = 0, Medium, Large + }; +}; + +struct UBSize +{ + enum Enum + { + Small = 0, Medium, Large + }; +}; + + struct UBItemLayerType { enum Enum @@ -80,7 +98,8 @@ struct UBGraphicsItemType CompassItemType, ProtractorItemType, StrokeItemType, - TriangleItemType + TriangleItemType, + MagnifierItemType, }; }; diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 84511d6a..2e8997b6 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -556,55 +556,49 @@ QList UBSettings::markerColors(bool onDarkBackground) } } +//----------------------------------------// +// eraser int UBSettings::eraserWidthIndex() { return value("Board/EraserCircleWidthIndex", 1).toInt(); } - void UBSettings::setEraserWidthIndex(int index) { setValue("Board/EraserCircleWidthIndex", index); } - qreal UBSettings::eraserFineWidth() { return value("Board/EraserFineWidth", 16).toDouble(); } - void UBSettings::setEraserFineWidth(qreal width) { setValue("Board/EraserFineWidth", width); } - qreal UBSettings::eraserMediumWidth() { return value("Board/EraserMediumWidth", 64).toDouble(); } - void UBSettings::setEraserMediumWidth(qreal width) { setValue("Board/EraserMediumWidth", width); } - qreal UBSettings::eraserStrongWidth() { return value("Board/EraserStrongWidth", 128).toDouble(); } - void UBSettings::setEraserStrongWidth(qreal width) { setValue("Board/EraserStrongWidth", width); } - qreal UBSettings::currentEraserWidth() { qreal width = 0; @@ -630,6 +624,169 @@ qreal UBSettings::currentEraserWidth() return width; } +//----------------------------------------// +// magnifier + +//-------------// +// zoom index + +int UBSettings::magnifierZoomIndex() +{ + return value("Board/MagnifierZoomIndex", 1).toInt(); +} + +void UBSettings::setMagnifierZoomIndex(int index) +{ + setValue("Board/MagnifierZoomIndex", index); +} + +//-------------// +// small zoom + +qreal UBSettings::magnifierSmallZoom() +{ + return value("Board/MagnifierSmallZoom", 2).toDouble(); +} + +void UBSettings::setMagnifierSmallZoom(qreal xZoom) +{ + setValue("Board/MagnifierSmallZoom", xZoom); +} + +//-------------// +// medium zoom + +qreal UBSettings::magnifierMediumZoom() +{ + return value("Board/MagnifierMediumZoom", 3).toDouble(); +} + +void UBSettings::setMagnifierMediumZoom(qreal xZoom) +{ + setValue("Board/MagnifierMediumZoom", xZoom); +} + +//-------------// +// large zoom + +qreal UBSettings::magnifierLargeZoom() +{ + return value("Board/MagnifierLargeZoom", 4).toDouble(); +} + +void UBSettings::setMagnifierLargeZoom(qreal xZoom) +{ + setValue("Board/MagnifierLargeZoom", xZoom); +} + +//-------------// + +qreal UBSettings::currentMagnifierZoom() +{ + qreal zoom = 0; + + switch (magnifierZoomIndex()) + { + case UBZoom::Small: + zoom = magnifierSmallZoom(); + break; + case UBZoom::Medium: + zoom = magnifierMediumZoom(); + break; + case UBZoom::Large: + zoom = magnifierLargeZoom(); + break; + default: + Q_ASSERT(false); + //failsafe + zoom = magnifierSmallZoom(); + break; + } + + return zoom; +} + +//-------------// +// size index + +int UBSettings::magnifierSizeIndex() +{ + return value("Board/MagnifierSizeIndex", 1).toInt(); +} + +void UBSettings::setMagnifierSizeIndex(int index) +{ + setValue("Board/MagnifierSizeIndex", index); +} + +//-------------// +// small zoom + +qreal UBSettings::magnifierSmallSize() +{ + return value("Board/MagnifierSmallSize", 10).toDouble(); +} + +void UBSettings::setMagnifierSmallSize(qreal xSize) +{ + setValue("Board/MagnifierSmallSize", xSize); +} + +//-------------// +// medium zoom + +qreal UBSettings::magnifierMediumSize() +{ + return value("Board/MagnifierMediumSize", 20).toDouble(); +} + +void UBSettings::setMagnifierMediumSize(qreal xSize) +{ + setValue("Board/MagnifierMediumSize", xSize); +} + +//-------------// +// large zoom + +qreal UBSettings::magnifierLargeSize() +{ + return value("Board/MagnifierLargeSize", 30).toDouble(); +} + +void UBSettings::setMagnifierLargeSize(qreal xSize) +{ + setValue("Board/MagnifierLargeSize", xSize); +} + +//-------------// + +qreal UBSettings::currentMagnifierSize() +{ + qreal size = 0; + + switch (magnifierSizeIndex()) + { + case UBSize::Small: + size = magnifierSmallSize(); + break; + case UBSize::Medium: + size = magnifierMediumSize(); + break; + case UBSize::Large: + size = magnifierLargeSize(); + break; + default: + Q_ASSERT(false); + //failsafe + size = magnifierSmallSize(); + break; + } + + return size; +} + +//----------------------------------------// + bool UBSettings::isDarkBackground() { diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index b93767ee..67afc057 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -66,6 +66,19 @@ class UBSettings : public QObject qreal eraserStrongWidth(); qreal currentEraserWidth(); + // Magnifier related + int magnifierZoomIndex(); + qreal magnifierSmallZoom(); + qreal magnifierMediumZoom(); + qreal magnifierLargeZoom(); + qreal currentMagnifierZoom(); + + int magnifierSizeIndex(); + qreal magnifierSmallSize(); + qreal magnifierMediumSize(); + qreal magnifierLargeSize(); + qreal currentMagnifierSize(); + // Background related bool isDarkBackground(); bool isCrossedBackground(); @@ -347,6 +360,17 @@ class UBSettings : public QObject void setEraserMediumWidth(qreal width); void setEraserStrongWidth(qreal width); + void setMagnifierZoomIndex(int index); + void setMagnifierSmallZoom(qreal xZoom); + void setMagnifierMediumZoom(qreal xZoom); + void setMagnifierLargeZoom(qreal xZoom); + + void setMagnifierSizeIndex(int index); + void setMagnifierSmallSize(qreal xSize); + void setMagnifierMediumSize(qreal xSize); + void setMagnifierLargeSize(qreal xSize); + + void setStylusPaletteVisible(bool visible); void setPenPressureSensitive(bool sensitive); diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 0974105f..fdc5bf82 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -29,6 +29,8 @@ #include "core/UBDisplayManager.h" #include "core/UBPersistenceManager.h" +#include "gui/UBMagnifer.h" + #include "tools/UBGraphicsRuler.h" #include "tools/UBGraphicsProtractor.h" #include "tools/UBGraphicsCompass.h" @@ -88,6 +90,8 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent) , mCurrentStroke(0) , mShouldUseOMP(true) , mItemCount(0) + , magniferControlViewWidget(0) + , magniferDisplayViewWidget(0) { #ifdef __ppc__ @@ -232,6 +236,15 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre drawPointer(scenePos); accepted = true; } + else if (currentTool == UBStylusTool::Magnifier) + { + CreateMagnifierQWidgets(QCursor::pos() /*scenePos*/); + magniferControlViewWidget->grabNMove(QCursor::pos(), true); + magniferDisplayViewWidget->grabNMove(scenePos, true); + magniferControlViewWidget->show(); + magniferDisplayViewWidget->show(); + accepted = true; + } } return accepted; @@ -305,6 +318,11 @@ bool UBGraphicsScene::inputDeviceMove(const QPointF& scenePos, const qreal& pres { drawPointer(position); } + else if (currentTool == UBStylusTool::Magnifier) + { + magniferControlViewWidget->grabNMove(QCursor::pos(), false); + magniferDisplayViewWidget->grabNMove(position, false); + } accepted = true; } @@ -329,15 +347,25 @@ bool UBGraphicsScene::inputDeviceRelease() bool accepted = false; + + if (mPointer) { mPointer->hide(); accepted = true; } - if (UBDrawingController::drawingController()->isDrawingTool()) + UBDrawingController *dc = UBDrawingController::drawingController(); + UBStylusTool::Enum currentTool = (UBStylusTool::Enum)dc->stylusTool(); + if (dc->isDrawingTool()) { mCurrentStroke = 0; + } + else + if (currentTool == UBStylusTool::Magnifier) + { + DisposeMagnifierQWidgets(); + //qDebug() << "deleted"; } if (mRemovedItems.size() > 0 || mAddedItems.size() > 0) @@ -395,6 +423,45 @@ void UBGraphicsScene::drawPointer(const QPointF &pPoint) } } +// call this function when user press mouse button in Magnifier mode +void UBGraphicsScene::CreateMagnifierQWidgets(const QPoint & globalPos) +{ + UBApplication::app()->setOverrideCursor( QCursor( Qt::BlankCursor ) ); + + magniferControlViewWidget = new UBMagnifer((QWidget*)(UBApplication::boardController->controlContainer())); + magniferControlViewWidget->setGrabView((QGraphicsView*)UBApplication::boardController->controlView()); + magniferControlViewWidget->setMoveView((QGraphicsView*)UBApplication::boardController->controlContainer()); + magniferControlViewWidget->setSize(UBSettings::settings()->currentMagnifierSize()); + magniferControlViewWidget->setZoom(UBSettings::settings()->currentMagnifierZoom()); + + magniferDisplayViewWidget = new UBMagnifer((QWidget*)(UBApplication::boardController->displayView())); + magniferDisplayViewWidget->setGrabView((QGraphicsView*)UBApplication::boardController->controlView()); + magniferDisplayViewWidget->setMoveView((QGraphicsView*)UBApplication::boardController->displayView()); + magniferDisplayViewWidget->setSize(UBSettings::settings()->currentMagnifierSize()); + magniferDisplayViewWidget->setZoom(UBSettings::settings()->currentMagnifierZoom()); +} + +// call this function when user release mouse button in Magnifier mode +void UBGraphicsScene::DisposeMagnifierQWidgets() +{ + if(magniferControlViewWidget) + { + magniferControlViewWidget->hide(); + magniferControlViewWidget->setParent(0); + delete magniferControlViewWidget; + magniferControlViewWidget = NULL; + } + + if(magniferDisplayViewWidget) + { + magniferDisplayViewWidget->hide(); + magniferDisplayViewWidget->setParent(0); + delete magniferDisplayViewWidget; + magniferDisplayViewWidget = NULL; + } + + UBApplication::app()->restoreOverrideCursor(); +} void UBGraphicsScene::moveTo(const QPointF &pPoint) { diff --git a/src/domain/UBGraphicsScene.h b/src/domain/UBGraphicsScene.h index e3d30af3..8092baf3 100644 --- a/src/domain/UBGraphicsScene.h +++ b/src/domain/UBGraphicsScene.h @@ -44,6 +44,7 @@ class UBAbstractWidget; class UBDocumentProxy; class UBGraphicsCurtainItem; class UBGraphicsStroke; +class UBMagnifer; const double PI = 4.0 * atan(1.0); @@ -288,6 +289,9 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem void drawEraser(const QPointF& pEndPoint); void drawPointer(const QPointF& pEndPoint); + void CreateMagnifierQWidgets(const QPoint &point); + void DisposeMagnifierQWidgets(); + virtual void keyReleaseEvent(QKeyEvent * keyEvent); @@ -347,6 +351,9 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem QList mFastAccessItems; // a local copy as QGraphicsScene::items() is very slow in Qt 4.6 //int mMesure1Ms, mMesure2Ms; + + UBMagnifer *magniferControlViewWidget; + UBMagnifer *magniferDisplayViewWidget; }; #endif /* UBGRAPHICSSCENE_H_ */ diff --git a/src/gui/UBMagnifer.cpp b/src/gui/UBMagnifer.cpp new file mode 100644 index 00000000..0888522e --- /dev/null +++ b/src/gui/UBMagnifer.cpp @@ -0,0 +1,155 @@ + +#include "UBMagnifer.h" +#include +#include +#include +#include +#include +#include +#include +#include + +UBMagnifer::UBMagnifer(QWidget *parent) + : QWidget(parent) + , gView(0) + , mView(0) + , sizePercentFromScene(20) + , inTimer(false) + , borderPen(Qt::darkGray) +{ + borderPen.setWidth(2); +} + +UBMagnifer::~UBMagnifer() +{ + if (timerUpdate != 0) + { + killTimer(timerUpdate); + timerUpdate = 0; + } +} + +void UBMagnifer::setSize(int percentFromScene) +{ + if(gView == NULL) return; + + // calculate object size + sizePercentFromScene = percentFromScene; + QSize sceneSize = gView->size(); + int size = sizePercentFromScene * sceneSize.width() / 100; + + setGeometry(0, 0, size, size); + + // prepare transparent bit mask + QImage mask_img(width(), height(), QImage::Format_Mono); + mask_img.fill(0xff); + QPainter mask_ptr(&mask_img); + mask_ptr.setBrush( QBrush( QColor(0, 0, 0) ) ); + mask_ptr.drawEllipse(QPoint(size/2, size/2), size/2, size/2); + bmpMask = QBitmap::fromImage(mask_img); + + // prepare general image + pMap = QPixmap(width(), height()); + pMap.fill(Qt::transparent); + pMap.setMask(bmpMask); +} + +void UBMagnifer::setZoom(int z) +{ + zoom = z; + + zWidth = size().width() / zoom; + zWidthHalf = zWidth / 2; + zHeight = size().height() / zoom; + zHeightHalf = zHeight / 2; +} + +void UBMagnifer::paintEvent(QPaintEvent *) +{ + QPainter p(this); + p.drawPixmap(0, 0, pMap); + + // in future replace to image border + QPen pen(Qt::darkGray); + pen.setWidth(2); + p.setPen(borderPen); + p.drawEllipse(QPoint( size().width() / 2, size().height() / 2), size().width() / 2, size().height() / 2); +} + +void UBMagnifer::timerEvent(QTimerEvent *e) +{ + if(inTimer) return; + if (e->timerId() == timerUpdate) + { + inTimer = true; + if(!(updPoint.isNull())) grabPoint(updPoint); + if(!(updPointF.isNull()))grabPoint(updPointF); + inTimer = false; + } +} + +void UBMagnifer::grabPoint(const QPoint &point) +{ + QPointF itemPos = gView->mapFromGlobal(point); + + int x = itemPos.x() - zWidthHalf; + int y = itemPos.y() - zHeightHalf; + + QPixmap newPixMap(QSize(zWidth,zHeight)); + ((QWidget*)gView)->render(&newPixMap, QPoint(0, 0), QRegion(x, y, zWidth, zHeight)); + pMap.fill(Qt::transparent); + pMap = newPixMap.scaled(QSize(width(), height())); + pMap.setMask(bmpMask); + + update(); +} + +void UBMagnifer::grabPoint(const QPointF &point) +{ + QPoint itemPos = gView->mapFromScene(point); + + int x = itemPos.x() - zWidthHalf; + int y = itemPos.y() - zHeightHalf; + + QPixmap newPixMap(QSize(zWidth,zHeight)); + ((QWidget*)gView)->render(&newPixMap, QPoint(0, 0), QRegion(x, y, zWidth, zHeight)); + pMap.fill(Qt::transparent); + pMap = newPixMap.scaled(QSize(width(), height())); + pMap.setMask(bmpMask); + + update(); +} + + +// from global +void UBMagnifer::grabNMove(const QPoint &point, bool needGrab = true) +{ + updPoint = point; + + if(needGrab) + grabPoint(point); + QPoint itemPos = mView->mapFromGlobal(point); + move(itemPos.x() - width()/2, itemPos.y() - height()/2); +// move(itemPos.x(), itemPos.y()); +} + +// from scene +void UBMagnifer::grabNMove(const QPointF &point, bool needGrab = true) +{ + updPointF = point; + + if(needGrab) + grabPoint(point); + QPoint itemPos = mView->mapFromScene(point); + move(itemPos.x() - width()/2, itemPos.y() - height()/2); +// move(itemPos.x(), itemPos.y()); +} + +void UBMagnifer::setGrabView(QGraphicsView *view) +{ + if (timerUpdate != 0) + killTimer(timerUpdate); + gView = view; + timerUpdate = startTimer(200); +} + diff --git a/src/gui/UBMagnifer.h b/src/gui/UBMagnifer.h new file mode 100644 index 00000000..435775a3 --- /dev/null +++ b/src/gui/UBMagnifer.h @@ -0,0 +1,60 @@ + +#ifndef UBMAGNIFER_H +#define UBMAGNIFER_H + +#include +#include +#include + +class QPixmap; +class QBitmap; +class QPen; +class QGraphicsView; + +class UBMagnifer : public QWidget +{ + Q_OBJECT + +public: + UBMagnifer(QWidget *parent = 0); + ~UBMagnifer(); + + void setSize(int percentFromScene); + void setZoom(int z); + + void setGrabView(QGraphicsView *view); + void setMoveView(QGraphicsView *view) {mView = view;} + + void grabPoint(const QPoint &point); + void grabPoint(const QPointF &point); + void grabNMove(const QPoint &point, bool needGrab); + void grabNMove(const QPointF &point, bool needGrab); + +protected: + void paintEvent(QPaintEvent *); + void timerEvent(QTimerEvent *); + + int sizePercentFromScene; + + +private: + int zoom; + int zWidth; + int zHeight; + int zWidthHalf; + int zHeightHalf; + bool inTimer; + + int timerUpdate; + QPoint updPoint; + QPointF updPointF; + + QPixmap pMap; + QBitmap bmpMask; + QPen borderPen; + + QGraphicsView *gView; + QGraphicsView *mView; +}; + +#endif // UBMAGNIFER_H diff --git a/src/gui/UBResources.cpp b/src/gui/UBResources.cpp index 9827a827..8c18bf0e 100644 --- a/src/gui/UBResources.cpp +++ b/src/gui/UBResources.cpp @@ -49,15 +49,16 @@ UBResources* UBResources::resources() void UBResources::init() { // Cursors - penCursor = QCursor(Qt::CrossCursor); - eraserCursor = QCursor(QPixmap(":/images/cursors/eraser.png"), 21, 21); - markerCursor = QCursor(QPixmap(":/images/cursors/marker.png"), 3, 30); - pointerCursor = QCursor(QPixmap(":/images/cursors/laser.png"), 2, 1); - handCursor = QCursor(Qt::OpenHandCursor); - zoomInCursor = QCursor(QPixmap(":/images/cursors/zoomIn.png"), 9, 9); - zoomOutCursor = QCursor(QPixmap(":/images/cursors/zoomOut.png"), 9, 9); - arrowCursor = QCursor(Qt::ArrowCursor); - textCursor = QCursor(Qt::ArrowCursor); - rotateCursor = QCursor(QPixmap(":/images/cursors/rotate.png"), 16, 16); + penCursor = QCursor(Qt::CrossCursor); + eraserCursor = QCursor(QPixmap(":/images/cursors/eraser.png"), 21, 21); + magnifierCursor = QCursor(QPixmap(":/images/cursors/zoomIn.png"), 9, 9); + markerCursor = QCursor(QPixmap(":/images/cursors/marker.png"), 3, 30); + pointerCursor = QCursor(QPixmap(":/images/cursors/laser.png"), 2, 1); + handCursor = QCursor(Qt::OpenHandCursor); + zoomInCursor = QCursor(QPixmap(":/images/cursors/zoomIn.png"), 9, 9); + zoomOutCursor = QCursor(QPixmap(":/images/cursors/zoomOut.png"), 9, 9); + arrowCursor = QCursor(Qt::ArrowCursor); + textCursor = QCursor(Qt::ArrowCursor); + rotateCursor = QCursor(QPixmap(":/images/cursors/rotate.png"), 16, 16); drawLineRulerCursor = QCursor(QPixmap(":/images/cursors/drawRulerLine.png"), 3, 12); } diff --git a/src/gui/UBResources.h b/src/gui/UBResources.h index bae4eee6..fd32fa6d 100644 --- a/src/gui/UBResources.h +++ b/src/gui/UBResources.h @@ -37,6 +37,7 @@ class UBResources : public QObject QCursor penCursor; QCursor eraserCursor; + QCursor magnifierCursor; QCursor markerCursor; QCursor pointerCursor; QCursor handCursor; diff --git a/src/gui/UBStylusPalette.cpp b/src/gui/UBStylusPalette.cpp index 93073ccd..4ae06f4c 100644 --- a/src/gui/UBStylusPalette.cpp +++ b/src/gui/UBStylusPalette.cpp @@ -37,6 +37,7 @@ UBStylusPalette::UBStylusPalette(QWidget *parent, Qt::Orientation orient) actions << UBApplication::mainWindow->actionPen; actions << UBApplication::mainWindow->actionEraser; + actions << UBApplication::mainWindow->actionMagnifier; actions << UBApplication::mainWindow->actionMarker; actions << UBApplication::mainWindow->actionSelector; diff --git a/src/gui/gui.pri b/src/gui/gui.pri index c1f18185..e1fa70a4 100644 --- a/src/gui/gui.pri +++ b/src/gui/gui.pri @@ -38,7 +38,8 @@ HEADERS += src/gui/UBThumbnailView.h \ src/gui/UBLibActionBar.h \ src/gui/UBLibraryWidget.h \ src/gui/UBLibPathViewer.h \ - src/gui/UBUpdateDlg.h + src/gui/UBUpdateDlg.h \ + src/gui/UBMagnifer.h SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBFloatingPalette.cpp \ @@ -79,7 +80,8 @@ SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBLibActionBar.cpp \ src/gui/UBLibraryWidget.cpp \ src/gui/UBLibPathViewer.cpp \ - src/gui/UBUpdateDlg.cpp + src/gui/UBUpdateDlg.cpp \ + src/gui/UBMagnifer.cpp win32 {