From 08abb806e74b2cb669309e5d84503d790a535551 Mon Sep 17 00:00:00 2001 From: Artem Proskurnev Date: Mon, 11 Apr 2022 13:09:13 +0300 Subject: [PATCH] Increasing the call area of the submenu. SVG icons - Arrow 7x7 -> 14x14 - eraser, pen and marker: png -> svg --- resources/OpenBoard.qrc | 12 + resources/forms/mainWindow.ui | 12 +- resources/images/stylusPalette/eraser.svg | 193 +++++++++++ .../images/stylusPalette/eraserArrow.svg | 199 +++++++++++ resources/images/stylusPalette/eraserOn.svg | 223 ++++++++++++ .../images/stylusPalette/eraserOnArrow.svg | 229 +++++++++++++ resources/images/stylusPalette/marker.svg | 224 +++++++++++++ .../images/stylusPalette/markerArrow.svg | 230 +++++++++++++ resources/images/stylusPalette/markerOn.svg | 256 ++++++++++++++ .../images/stylusPalette/markerOnArrow.svg | 262 +++++++++++++++ resources/images/stylusPalette/pen.svg | 280 ++++++++++++++++ resources/images/stylusPalette/penArrow.svg | 286 ++++++++++++++++ resources/images/stylusPalette/penOn.svg | 310 +++++++++++++++++ resources/images/stylusPalette/penOnArrow.svg | 316 ++++++++++++++++++ src/desktop/UBDesktopAnnotationController.cpp | 6 +- src/desktop/UBDesktopPalette.cpp | 24 +- 16 files changed, 3041 insertions(+), 21 deletions(-) create mode 100644 resources/images/stylusPalette/eraser.svg create mode 100644 resources/images/stylusPalette/eraserArrow.svg create mode 100644 resources/images/stylusPalette/eraserOn.svg create mode 100644 resources/images/stylusPalette/eraserOnArrow.svg create mode 100644 resources/images/stylusPalette/marker.svg create mode 100644 resources/images/stylusPalette/markerArrow.svg create mode 100644 resources/images/stylusPalette/markerOn.svg create mode 100644 resources/images/stylusPalette/markerOnArrow.svg create mode 100644 resources/images/stylusPalette/pen.svg create mode 100644 resources/images/stylusPalette/penArrow.svg create mode 100644 resources/images/stylusPalette/penOn.svg create mode 100644 resources/images/stylusPalette/penOnArrow.svg diff --git a/resources/OpenBoard.qrc b/resources/OpenBoard.qrc index 480269c1..9327c9e7 100644 --- a/resources/OpenBoard.qrc +++ b/resources/OpenBoard.qrc @@ -366,5 +366,17 @@ images/desc.png images/toolPalette/axesTool.png images/numbersTool.svg + images/stylusPalette/eraserArrow.svg + images/stylusPalette/penArrow.svg + images/stylusPalette/eraserOnArrow.svg + images/stylusPalette/eraserOn.svg + images/stylusPalette/eraser.svg + images/stylusPalette/marker.svg + images/stylusPalette/markerArrow.svg + images/stylusPalette/markerOn.svg + images/stylusPalette/markerOnArrow.svg + images/stylusPalette/pen.svg + images/stylusPalette/penOn.svg + images/stylusPalette/penOnArrow.svg diff --git a/resources/forms/mainWindow.ui b/resources/forms/mainWindow.ui index 8b08f03c..052230ac 100644 --- a/resources/forms/mainWindow.ui +++ b/resources/forms/mainWindow.ui @@ -1192,8 +1192,8 @@ - :/images/stylusPalette/pen.png - :/images/stylusPalette/penOn.png:/images/stylusPalette/pen.png + :/images/stylusPalette/pen.svg + :/images/stylusPalette/penOn.svg:/images/stylusPalette/pen.svg Pen @@ -1211,8 +1211,8 @@ - :/images/stylusPalette/eraser.png - :/images/stylusPalette/eraserOn.png:/images/stylusPalette/eraser.png + :/images/stylusPalette/eraser.svg + :/images/stylusPalette/eraserOn.svg:/images/stylusPalette/eraser.svg Eraser @@ -1230,8 +1230,8 @@ - :/images/stylusPalette/marker.png - :/images/stylusPalette/markerOn.png:/images/stylusPalette/marker.png + :/images/stylusPalette/marker.svg + :/images/stylusPalette/markerOn.svg:/images/stylusPalette/marker.svg Marker diff --git a/resources/images/stylusPalette/eraser.svg b/resources/images/stylusPalette/eraser.svg new file mode 100644 index 00000000..aba1b8b1 --- /dev/null +++ b/resources/images/stylusPalette/eraser.svg @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/eraserArrow.svg b/resources/images/stylusPalette/eraserArrow.svg new file mode 100644 index 00000000..21e35455 --- /dev/null +++ b/resources/images/stylusPalette/eraserArrow.svg @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/eraserOn.svg b/resources/images/stylusPalette/eraserOn.svg new file mode 100644 index 00000000..84e14906 --- /dev/null +++ b/resources/images/stylusPalette/eraserOn.svg @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/eraserOnArrow.svg b/resources/images/stylusPalette/eraserOnArrow.svg new file mode 100644 index 00000000..6f3c719d --- /dev/null +++ b/resources/images/stylusPalette/eraserOnArrow.svg @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/marker.svg b/resources/images/stylusPalette/marker.svg new file mode 100644 index 00000000..2d9a2c39 --- /dev/null +++ b/resources/images/stylusPalette/marker.svg @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/markerArrow.svg b/resources/images/stylusPalette/markerArrow.svg new file mode 100644 index 00000000..0e2b9ad6 --- /dev/null +++ b/resources/images/stylusPalette/markerArrow.svg @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/markerOn.svg b/resources/images/stylusPalette/markerOn.svg new file mode 100644 index 00000000..5e874b3a --- /dev/null +++ b/resources/images/stylusPalette/markerOn.svg @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/markerOnArrow.svg b/resources/images/stylusPalette/markerOnArrow.svg new file mode 100644 index 00000000..80bb8213 --- /dev/null +++ b/resources/images/stylusPalette/markerOnArrow.svg @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/pen.svg b/resources/images/stylusPalette/pen.svg new file mode 100644 index 00000000..0b2b3176 --- /dev/null +++ b/resources/images/stylusPalette/pen.svg @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/penArrow.svg b/resources/images/stylusPalette/penArrow.svg new file mode 100644 index 00000000..0ef25469 --- /dev/null +++ b/resources/images/stylusPalette/penArrow.svg @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/penOn.svg b/resources/images/stylusPalette/penOn.svg new file mode 100644 index 00000000..8e07f511 --- /dev/null +++ b/resources/images/stylusPalette/penOn.svg @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/stylusPalette/penOnArrow.svg b/resources/images/stylusPalette/penOnArrow.svg new file mode 100644 index 00000000..58e6fe2e --- /dev/null +++ b/resources/images/stylusPalette/penOnArrow.svg @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 564ca812..ba269aa9 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -561,7 +561,7 @@ void UBDesktopAnnotationController::penActionPressed() int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette - if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44) + if(iX >= 30 && iX <= 44 && iY >= 30 && iY <= 44) { mbArrowClicked = true; penActionReleased(); @@ -615,7 +615,7 @@ void UBDesktopAnnotationController::eraserActionPressed() int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette - if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44) + if(iX >= 30 && iX <= 44 && iY >= 30 && iY <= 44) { mbArrowClicked = true; eraserActionReleased(); @@ -670,7 +670,7 @@ void UBDesktopAnnotationController::markerActionPressed() int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette - if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44) + if(iX >= 30 && iX <= 44 && iY >= 30 && iY <= 44) { mbArrowClicked = true; markerActionReleased(); diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index 2346e4ac..4ef402b6 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -214,14 +214,14 @@ void UBDesktopPalette::showEvent(QShowEvent *event) QIcon penIcon; QIcon markerIcon; QIcon eraserIcon; - penIcon.addPixmap(QPixmap(":images/stylusPalette/penArrow.png"), QIcon::Normal, QIcon::Off); - penIcon.addPixmap(QPixmap(":images/stylusPalette/penOnArrow.png"), QIcon::Normal, QIcon::On); + penIcon.addFile(":images/stylusPalette/penArrow.svg", QSize(), QIcon::Normal, QIcon::Off); + penIcon.addFile(":images/stylusPalette/penOnArrow.svg", QSize(), QIcon::Normal, QIcon::On); UBApplication::mainWindow->actionPen->setIcon(penIcon); - markerIcon.addPixmap(QPixmap(":images/stylusPalette/markerArrow.png"), QIcon::Normal, QIcon::Off); - markerIcon.addPixmap(QPixmap(":images/stylusPalette/markerOnArrow.png"), QIcon::Normal, QIcon::On); + markerIcon.addFile(":images/stylusPalette/markerArrow.svg", QSize(), QIcon::Normal, QIcon::Off); + markerIcon.addFile(":images/stylusPalette/markerOnArrow.svg", QSize(), QIcon::Normal, QIcon::On); UBApplication::mainWindow->actionMarker->setIcon(markerIcon); - eraserIcon.addPixmap(QPixmap(":images/stylusPalette/eraserArrow.png"), QIcon::Normal, QIcon::Off); - eraserIcon.addPixmap(QPixmap(":images/stylusPalette/eraserOnArrow.png"), QIcon::Normal, QIcon::On); + eraserIcon.addFile(":images/stylusPalette/eraserArrow.svg", QSize(), QIcon::Normal, QIcon::Off); + eraserIcon.addFile(":images/stylusPalette/eraserOnArrow.svg", QSize(), QIcon::Normal, QIcon::On); UBApplication::mainWindow->actionEraser->setIcon(eraserIcon); adjustPosition(); @@ -233,14 +233,14 @@ void UBDesktopPalette::hideEvent(QHideEvent *event) QIcon penIcon; QIcon markerIcon; QIcon eraserIcon; - penIcon.addPixmap(QPixmap(":images/stylusPalette/pen.png"), QIcon::Normal, QIcon::Off); - penIcon.addPixmap(QPixmap(":images/stylusPalette/penOn.png"), QIcon::Normal, QIcon::On); + penIcon.addFile(":images/stylusPalette/pen.svg", QSize(), QIcon::Normal, QIcon::Off); + penIcon.addFile(":images/stylusPalette/penOn.svg", QSize(), QIcon::Normal, QIcon::On); UBApplication::mainWindow->actionPen->setIcon(penIcon); - markerIcon.addPixmap(QPixmap(":images/stylusPalette/marker.png"), QIcon::Normal, QIcon::Off); - markerIcon.addPixmap(QPixmap(":images/stylusPalette/markerOn.png"), QIcon::Normal, QIcon::On); + markerIcon.addFile(":images/stylusPalette/marker.svg", QSize(), QIcon::Normal, QIcon::Off); + markerIcon.addFile(":images/stylusPalette/markerOn.svg", QSize(), QIcon::Normal, QIcon::On); UBApplication::mainWindow->actionMarker->setIcon(markerIcon); - eraserIcon.addPixmap(QPixmap(":images/stylusPalette/eraser.png"), QIcon::Normal, QIcon::Off); - eraserIcon.addPixmap(QPixmap(":images/stylusPalette/eraserOn.png"), QIcon::Normal, QIcon::On); + eraserIcon.addFile(":images/stylusPalette/eraser.svg", QSize(), QIcon::Normal, QIcon::Off); + eraserIcon.addFile(":images/stylusPalette/eraserOn.svg", QSize(), QIcon::Normal, QIcon::On); UBApplication::mainWindow->actionEraser->setIcon(eraserIcon); }