Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
012e8384
Commit
012e8384
authored
Feb 19, 2018
by
Clément Fauconnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a 'reset background grid size' button in the background palette
parent
2b7d01ad
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
0 deletions
+53
-0
OpenBoard.qrc
resources/OpenBoard.qrc
+1
-0
mainWindow.ui
resources/forms/mainWindow.ui
+12
-0
resetDefaultGridSize.svg
resources/images/backgroundPalette/resetDefaultGridSize.svg
+21
-0
UBSettings.cpp
src/core/UBSettings.cpp
+1
-0
UBSettings.h
src/core/UBSettings.h
+1
-0
UBBackgroundPalette.cpp
src/gui/UBBackgroundPalette.cpp
+15
-0
UBBackgroundPalette.h
src/gui/UBBackgroundPalette.h
+2
-0
No files found.
resources/OpenBoard.qrc
View file @
012e8384
...
...
@@ -359,5 +359,6 @@
<file>images/groupItems.svg</file>
<file>images/ungroupItems.svg</file>
<file>images/setAsBackground.svg</file>
<file>images/backgroundPalette/resetDefaultGridSize.svg</file>
</qresource>
</RCC>
resources/forms/mainWindow.ui
View file @
012e8384
...
...
@@ -1647,6 +1647,18 @@
<string>
Open the tutorial web page
</string>
</property>
</action>
<action
name=
"actionDefaultGridSize"
>
<property
name=
"icon"
>
<iconset
resource=
"../OpenBoard.qrc"
>
<normaloff>
:/images/backgroundPalette/resetDefaultGridSize.svg
</normaloff>
:/images/backgroundPalette/resetDefaultGridSize.svg
</iconset>
</property>
<property
name=
"text"
>
<string>
Default Grid Size
</string>
</property>
<property
name=
"toolTip"
>
<string>
return to Default Grid Size
</string>
</property>
</action>
</widget>
<resources>
<include
location=
"../OpenBoard.qrc"
/>
...
...
resources/images/backgroundPalette/resetDefaultGridSize.svg
0 → 100644
View file @
012e8384
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"26.724px"
height=
"22.304px"
viewBox=
"2.233 3.234 26.724 22.304"
enable-background=
"new 2.233 3.234 26.724 22.304"
xml:space=
"preserve"
>
<g>
<path
fill=
"#333333"
stroke=
"#CECECD"
stroke-miterlimit=
"3.8637"
d=
"M20.228,3.732c4.545,0,8.229,3.687,8.229,8.232v4.838
c0,4.547-3.686,8.231-8.229,8.231h-9.246c-4.547,0-8.231-3.687-8.231-8.231v-4.838c0-4.547,3.687-8.232,8.231-8.232H20.228z"
/>
<path
fill=
"#FFFFFF"
d=
"M14.28,10.516c-1.023-0.006-2.032,0.475-2.663,1.376c-1.021,1.457-0.663,3.459,0.798,4.48
c0.061,0.043,0.106,0.09,0.145,0.139l0.108-2.099c0.021-0.402,0.335-0.733,0.726-0.714c0.391,0.021,0.667,0.383,0.646,0.784
l-0.148,2.812l-0.071,1.369l-1.367-0.072L9.64,18.446c-0.401-0.021-0.732-0.335-0.714-0.725c0.021-0.39,0.384-0.668,0.785-0.646
l1.875,0.1c-1.822-1.416-2.241-4.021-0.899-5.938c0.863-1.234,2.253-1.886,3.61-1.869c0.183,0.002,0.358,0.023,0.537,0.049
c0.376,0.05,0.524,0.371,0.488,0.64c-0.035,0.27-0.266,0.538-0.641,0.488c-0.158-0.021-0.317-0.031-0.479-0.028H14.28z
M16.999,17.831c1.022,0.006,2.032-0.475,2.663-1.375c1.021-1.458,0.662-3.459-0.797-4.482c-0.061-0.041-0.107-0.088-0.146-0.138
l-0.107,2.099c-0.021,0.402-0.336,0.734-0.725,0.714c-0.392-0.02-0.668-0.383-0.646-0.784l0.148-2.812l0.071-1.369l1.367,0.072
L21.64,9.9c0.399,0.021,0.731,0.335,0.713,0.726c-0.021,0.389-0.383,0.667-0.785,0.646l-1.875-0.1
c1.822,1.416,2.24,4.021,0.899,5.937c-0.864,1.234-2.254,1.886-3.612,1.869c-0.182-0.002-0.357-0.022-0.537-0.048
c-0.375-0.052-0.523-0.371-0.487-0.64c0.036-0.271,0.266-0.539,0.642-0.488c0.157,0.021,0.316,0.029,0.479,0.027h-0.077V17.831z"
/>
</g>
</svg>
src/core/UBSettings.cpp
View file @
012e8384
...
...
@@ -47,6 +47,7 @@ QPointer<UBSettings> UBSettings::sSingleton = 0;
int
UBSettings
::
pointerDiameter
=
40
;
int
UBSettings
::
crossSize
=
24
;
int
UBSettings
::
defaultCrossSize
=
24
;
int
UBSettings
::
minCrossSize
=
12
;
int
UBSettings
::
maxCrossSize
=
96
;
//TODO: user-settable?
int
UBSettings
::
colorPaletteSize
=
5
;
...
...
src/core/UBSettings.h
View file @
012e8384
...
...
@@ -188,6 +188,7 @@ class UBSettings : public QObject
// Background grid
static
int
crossSize
;
static
int
defaultCrossSize
;
static
int
minCrossSize
;
static
int
maxCrossSize
;
...
...
src/gui/UBBackgroundPalette.cpp
View file @
012e8384
#include "UBBackgroundPalette.h"
#include "gui/UBMainWindow.h"
UBBackgroundPalette
::
UBBackgroundPalette
(
QList
<
QAction
*>
actions
,
QWidget
*
parent
)
:
UBActionPalette
(
parent
)
{
...
...
@@ -47,9 +49,16 @@ void UBBackgroundPalette::init()
mSliderLabel
=
new
QLabel
(
tr
(
"Grid size"
));
mResetDefaultGridSizeButton
=
createPaletteButton
(
UBApplication
::
mainWindow
->
actionDefaultGridSize
,
this
);
mResetDefaultGridSizeButton
->
setFixedSize
(
24
,
24
);
mActions
<<
UBApplication
::
mainWindow
->
actionDefaultGridSize
;
connect
(
UBApplication
::
mainWindow
->
actionDefaultGridSize
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
defaultBackgroundGridSize
()));
mBottomLayout
->
addSpacing
(
16
);
mBottomLayout
->
addWidget
(
mSliderLabel
);
mBottomLayout
->
addWidget
(
mSlider
);
mBottomLayout
->
addWidget
(
mResetDefaultGridSizeButton
);
mBottomLayout
->
addSpacing
(
16
);
updateLayout
();
...
...
@@ -137,6 +146,12 @@ void UBBackgroundPalette::sliderValueChanged(int value)
UBSettings
::
settings
()
->
crossSize
=
value
;
// since this function is called (indirectly, by refresh) when we switch scenes, the settings will always have the current scene's cross size.
}
void
UBBackgroundPalette
::
defaultBackgroundGridSize
()
{
mSlider
->
setValue
(
UBSettings
::
settings
()
->
defaultCrossSize
);
sliderValueChanged
(
UBSettings
::
settings
()
->
defaultCrossSize
);
}
void
UBBackgroundPalette
::
backgroundChanged
()
{
bool
dark
=
UBApplication
::
boardController
->
activeScene
()
->
isDarkBackground
();
...
...
src/gui/UBBackgroundPalette.h
View file @
012e8384
...
...
@@ -27,6 +27,7 @@ class UBBackgroundPalette : public UBActionPalette
protected
slots
:
void
sliderValueChanged
(
int
value
);
void
defaultBackgroundGridSize
();
protected
:
virtual
void
updateLayout
();
...
...
@@ -39,6 +40,7 @@ class UBBackgroundPalette : public UBActionPalette
QSlider
*
mSlider
;
QLabel
*
mSliderLabel
;
UBActionPaletteButton
*
mResetDefaultGridSizeButton
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment