added grid tab on preferences to handle grid color and opacity parameters

preferencesAboutTextFull
Clément Fauconnier 7 years ago
parent 0d66ec255d
commit c6c0120aab
  1. 4
      resources/etc/OpenBoard.config
  2. 213
      resources/forms/brushProperties.ui
  3. 428
      resources/forms/preferences.ui
  4. 117
      src/core/UBPreferencesController.cpp
  5. 8
      src/core/UBPreferencesController.h
  6. 12
      src/core/UBSetting.cpp
  7. 11
      src/core/UBSettings.cpp
  8. 3
      src/core/UBSettings.h

@ -25,12 +25,14 @@ UseSystemOnScreenKeyboard=true
[Board]
AutoSaveIntervalInMinutes=3
CrossColorDarkBackground=#C8C0C0C0
CrossColorDarkBackground=#C82C2C2C
CrossColorLightBackground=#A5E1FF
DarkBackground=0
DefaultPageSize=@Size(1280 960)
EraserCircleWidthIndex=1
FeatureSliderPosition=40
GridDarkBackgroundColors=#FFFFFF, #FF3400, #66C0FF, #81FF5C, #FFFF00, #B68360, #FF497E, #8D69FF, #C82C2C2C
GridLightBackgroundColors=#000000, #FF0000, #004080, #008000, #FFDD00, #C87400, #800040, #008080, #5F2D0A, #A5E1FF
InterpolateMarkerStrokes=true
InterpolatePenStrokes=true
KeyboardPaletteKeyBtnSize=16x16

@ -20,7 +20,7 @@
<enum>QFrame::Plain</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="5" column="0" colspan="3">
<item row="6" column="1" colspan="4">
<widget class="QFrame" name="pressureFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
@ -70,24 +70,78 @@
</layout>
</widget>
</item>
<item row="0" column="1">
<spacer name="nSpacer">
<item row="2" column="1" colspan="4">
<widget class="QFrame" name="opacityFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="wSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<property name="sizeHint" stdset="0">
<size>
<width>154</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="opacityLabel">
<property name="text">
<string>Opacity</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="opacitySlider">
<property name="minimum">
<number>20</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>20</number>
</property>
</widget>
</item>
<item>
<spacer name="eSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<width>156</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
</layout>
</widget>
</item>
<item row="1" column="1" colspan="4">
<widget class="QFrame" name="colorFrame">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
@ -146,6 +200,19 @@
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QFrame" name="darkBackgroundFrame">
<property name="frameShape">
@ -197,74 +264,7 @@
</layout>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QFrame" name="opacityFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="wSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>154</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="opacityLabel">
<property name="text">
<string>Opacity</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="opacitySlider">
<property name="minimum">
<number>20</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>20</number>
</property>
</widget>
</item>
<item>
<spacer name="eSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>156</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="3">
<item row="4" column="1" colspan="4">
<widget class="QGroupBox" name="lineWidthGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -458,7 +458,7 @@
</layout>
</widget>
</item>
<item row="3" column="1">
<item row="3" column="2">
<spacer name="cSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -471,33 +471,7 @@
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="nwSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="neSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<item row="5" column="1">
<widget class="QFrame" name="circleFrame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
@ -518,19 +492,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<spacer name="cspacerleft">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="circleCheckBox">
<property name="sizePolicy">
@ -554,7 +515,10 @@
</property>
</widget>
</item>
<item>
</layout>
</widget>
</item>
<item row="5" column="3">
<spacer name="cspacerright">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -569,20 +533,17 @@
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>UBCircleFrame</class>
<class>UBColorPicker</class>
<extends>QFrame</extends>
<header>gui/UBCircleFrame.h</header>
<header>gui/UBColorPicker.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>UBColorPicker</class>
<class>UBCircleFrame</class>
<extends>QFrame</extends>
<header>gui/UBColorPicker.h</header>
<header>gui/UBCircleFrame.h</header>
<container>1</container>
</customwidget>
</customwidgets>

@ -14,6 +14,64 @@
<string>Preferences</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="defaultSettingsButton">
<property name="text">
<string>Default Settings</string>
</property>
</widget>
</item>
<item>
<spacer name="bottomHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="versionLabel">
<property name="text">
@ -24,7 +82,7 @@
<item row="1" column="0">
<widget class="QTabWidget" name="mainTabWidget">
<property name="currentIndex">
<number>6</number>
<number>1</number>
</property>
<widget class="QWidget" name="displayTab">
<attribute name="title">
@ -477,6 +535,300 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="gridTab">
<attribute name="title">
<string>Grid</string>
</attribute>
<widget class="QFrame" name="gridFrame">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>-1</x>
<y>-1</y>
<width>741</width>
<height>591</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QFrame" name="frame_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>741</width>
<height>611</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QFrame" name="crossColorDarkBackgroundFrame">
<property name="geometry">
<rect>
<x>260</x>
<y>30</y>
<width>221</width>
<height>50</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="crossColorDarkBackgroundLayout">
<item>
<widget class="QLabel" name="crossColorDarkBackgroundLabel">
<property name="text">
<string>On Dark Background</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="UBColorPicker" name="crossColorDarkBackgroundColorPicker">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QFrame" name="darkBackgroundOpacityFrame">
<property name="geometry">
<rect>
<x>0</x>
<y>90</y>
<width>741</width>
<height>52</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<spacer name="wSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>154</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="darkBackgroundOpacityLabel">
<property name="text">
<string>Opacity</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="darkBackgroundOpacitySlider">
<property name="minimum">
<number>20</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>20</number>
</property>
</widget>
</item>
<item>
<spacer name="eSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>156</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QFrame" name="crossColorLightBackgroundFrame">
<property name="geometry">
<rect>
<x>260</x>
<y>150</y>
<width>221</width>
<height>51</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="crossColorLightBackgroundLayout">
<item>
<widget class="QLabel" name="crossColorLightBackgroundLabel">
<property name="text">
<string>On Light Background</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="UBColorPicker" name="crossColorLightBackgroundColorPicker">
<property name="minimumSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QFrame" name="lightBackgroundOpacityFrame">
<property name="geometry">
<rect>
<x>0</x>
<y>210</y>
<width>741</width>
<height>52</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<spacer name="wSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>154</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="lightBackgroundOpacityLabel">
<property name="text">
<string>Opacity</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="lightBackgroundOpacitySlider">
<property name="minimum">
<number>20</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksAbove</enum>
</property>
<property name="tickInterval">
<number>20</number>
</property>
</widget>
</item>
<item>
<spacer name="eSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>156</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</widget>
</widget>
<widget class="QWidget" name="penTab">
<attribute name="title">
<string>Pen</string>
@ -2657,7 +3009,7 @@ Public License instead of this License. But first, please read
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:12pt; font-weight:600;&quot;&gt;Translations&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:10pt;&quot;&gt;A special thanks to:&lt;/span&gt;&lt;/p&gt;
@ -2751,7 +3103,7 @@ p, li { white-space: pre-wrap; }
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
&lt;tr&gt;
&lt;td style=&quot;border: none;&quot;&gt;
@ -2770,8 +3122,8 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:10pt;&quot;&gt;Case Postale 241&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:10pt;&quot;&gt;1211 Genève 8&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:10pt;&quot;&gt;Switzerland&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://www.openboard.ch&quot;&gt;&lt;span style=&quot; font-family:'.Helvetica Neue DeskInterface'; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;openboard.ch&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface'; font-size:11pt; text-decoration: underline; color:#0000ff;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a href=&quot;http://www.openboard.ch&quot;&gt;&lt;span style=&quot; font-family:'.Helvetica Neue DeskInterface'; text-decoration: underline; color:#0000ff;&quot;&gt;openboard.ch&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'.Helvetica Neue DeskInterface'; text-decoration: underline; color:#0000ff;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:10pt;&quot;&gt;email: &lt;/span&gt;&lt;a href=&quot;mailto:sem.logistique@edu.ge.ch&quot;&gt;&lt;span style=&quot; font-family:'Cantarell'; font-size:10pt; text-decoration: underline; color:#0000ff;&quot;&gt;sem.logistique@edu.ge.ch&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
@ -2859,66 +3211,16 @@ p, li { white-space: pre-wrap; }
</widget>
</widget>
</item>
<item row="3" column="0">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="defaultSettingsButton">
<property name="text">
<string>Default Settings</string>
</property>
</widget>
</item>
<item>
<spacer name="bottomHSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>UBColorPicker</class>
<extends>QFrame</extends>
<header>gui/UBColorPicker.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mainTabWidget</tabstop>
<tabstop>useExternalBrowserCheckBox</tabstop>

@ -39,6 +39,7 @@
#include "core/UBDisplayManager.h"
#include "board/UBBoardController.h"
#include "domain/UBGraphicsScene.h"
#include "board/UBDrawingController.h"
#include "podcast/UBPodcastController.h"
@ -76,6 +77,8 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
, mPreferencesUI(0)
, mPenProperties(0)
, mMarkerProperties(0)
, mDarkBackgroundGridColorPicker(0)
, mLightBackgroundGridColorPicker(0)
{
mDesktop = qApp->desktop();
mPreferencesWindow = new UBPreferencesDialog(this,parent, Qt::Dialog);
@ -97,6 +100,10 @@ UBPreferencesController::~UBPreferencesController()
delete mPenProperties;
delete mMarkerProperties;
delete mDarkBackgroundGridColorPicker;
delete mLightBackgroundGridColorPicker;
}
void UBPreferencesController::adjustScreens(int screen)
@ -149,6 +156,43 @@ void UBPreferencesController::wire()
connect(mPreferencesUI->verticalChoice, SIGNAL(clicked(bool)), this, SLOT(toolbarOrientationVertical(bool)));
connect(mPreferencesUI->toolbarDisplayTextCheckBox, SIGNAL(clicked(bool)), settings->appToolBarDisplayText, SLOT(setBool(bool)));
//grid tab
//On light background
QList<QColor> gridLightBackgroundColors = settings->boardGridLightBackgroundColors->colors();
QColor selectedCrossColorLightBackground(settings->boardCrossColorLightBackground->get().toString());
mLightBackgroundGridColorPicker = new UBColorPicker(mPreferencesUI->crossColorLightBackgroundFrame);
mLightBackgroundGridColorPicker->setObjectName(QString::fromUtf8("crossColorLightBackgroundFrame"));
mLightBackgroundGridColorPicker->setMinimumSize(QSize(32, 32));
mLightBackgroundGridColorPicker->setFrameShape(QFrame::StyledPanel);
mLightBackgroundGridColorPicker->setFrameShadow(QFrame::Raised);
mPreferencesUI->crossColorLightBackgroundLayout->addWidget(mLightBackgroundGridColorPicker);
mLightBackgroundGridColorPicker->setColors(gridLightBackgroundColors);
mLightBackgroundGridColorPicker->setSelectedColorIndex(gridLightBackgroundColors.indexOf(selectedCrossColorLightBackground));
mPreferencesUI->lightBackgroundOpacitySlider->setValue(selectedCrossColorLightBackground.alpha()*100 / 255);
QObject::connect(mLightBackgroundGridColorPicker, SIGNAL(colorSelected(const QColor&)), this, SLOT(setCrossColorOnLightBackground(const QColor&)));
connect(mPreferencesUI->lightBackgroundOpacitySlider, SIGNAL(valueChanged(int)), this, SLOT(lightBackgroundCrossOpacityValueChanged(int)));
//On dark background
QList<QColor> gridDarkBackgroundColors = settings->boardGridDarkBackgroundColors->colors();
QColor selectedCrossColorDarkBackground(settings->boardCrossColorDarkBackground->get().toString());
mDarkBackgroundGridColorPicker = new UBColorPicker(mPreferencesUI->crossColorDarkBackgroundFrame);
mDarkBackgroundGridColorPicker->setObjectName(QString::fromUtf8("crossColorDarkBackgroundFrame"));
mDarkBackgroundGridColorPicker->setMinimumSize(QSize(32, 32));
mDarkBackgroundGridColorPicker->setFrameShape(QFrame::StyledPanel);
mDarkBackgroundGridColorPicker->setFrameShadow(QFrame::Raised);
mPreferencesUI->crossColorDarkBackgroundLayout->addWidget(mDarkBackgroundGridColorPicker);
mDarkBackgroundGridColorPicker->setColors(gridDarkBackgroundColors);
mDarkBackgroundGridColorPicker->setSelectedColorIndex(gridDarkBackgroundColors.indexOf(selectedCrossColorDarkBackground));
mPreferencesUI->darkBackgroundOpacitySlider->setValue(selectedCrossColorDarkBackground.alpha()*100 / 255);
QObject::connect(mDarkBackgroundGridColorPicker, SIGNAL(colorSelected(const QColor&)), this, SLOT(setCrossColorOnDarkBackground(const QColor&)));
connect(mPreferencesUI->darkBackgroundOpacitySlider, SIGNAL(valueChanged(int)), this, SLOT(darkBackgroundCrossOpacityValueChanged(int)));
// pen
QList<QColor> penLightBackgroundColors = settings->boardPenLightBackgroundColors->colors();
QList<QColor> penDarkBackgroundColors = settings->boardPenDarkBackgroundColors->colors();
@ -340,6 +384,54 @@ void UBPreferencesController::defaultSettings()
}
void UBPreferencesController::darkBackgroundCrossOpacityValueChanged(int value)
{
UBSettings* settings = UBSettings::settings();
int opacity = value * 255 / 100;
QList<QColor> gridDarkBackgroundColors = settings->boardGridDarkBackgroundColors->colors();
int index = mDarkBackgroundGridColorPicker->selectedColorIndex();
QColor currentColor = gridDarkBackgroundColors.at(index);
currentColor.setAlpha(opacity);
gridDarkBackgroundColors.replace(index, currentColor);
mDarkBackgroundGridColorPicker->setColors(gridDarkBackgroundColors);
settings->boardGridDarkBackgroundColors->setColor(index, currentColor);
UBSettings::settings()->boardCrossColorDarkBackground->set(currentColor.name(QColor::HexArgb));
if (UBApplication::boardController && UBApplication::boardController->activeScene())
{
foreach(QGraphicsView* view, UBApplication::boardController->activeScene()->views())
view->resetCachedContent();
}
}
void UBPreferencesController::lightBackgroundCrossOpacityValueChanged(int value)
{
UBSettings* settings = UBSettings::settings();
int opacity = value * 255 / 100;
QList<QColor> gridLightBackgroundColors = settings->boardGridLightBackgroundColors->colors();
int index = mLightBackgroundGridColorPicker->selectedColorIndex();
QColor currentColor = gridLightBackgroundColors.at(index);
currentColor.setAlpha(opacity);
gridLightBackgroundColors.replace(index, currentColor);
mLightBackgroundGridColorPicker->setColors(gridLightBackgroundColors);
settings->boardGridLightBackgroundColors->setColor(index, currentColor);
UBSettings::settings()->boardCrossColorLightBackground->set(currentColor.name(QColor::HexArgb));
if (UBApplication::boardController && UBApplication::boardController->activeScene())
{
foreach(QGraphicsView* view, UBApplication::boardController->activeScene()->views())
view->resetCachedContent();
}
}
void UBPreferencesController::penPreviewFromSizeChanged(int value)
{
UBSettings::settings()->setPenPreviewFromSize(value);
@ -446,6 +538,31 @@ void UBPreferencesController::colorSelected(const QColor& color)
}
void UBPreferencesController::setCrossColorOnDarkBackground(const QColor& color)
{
UBSettings::settings()->boardCrossColorDarkBackground->set(color.name(QColor::HexArgb));
mPreferencesUI->darkBackgroundOpacitySlider->setValue(color.alpha() * 100 / 255);
if (UBApplication::boardController && UBApplication::boardController->activeScene())
{
foreach(QGraphicsView* view, UBApplication::boardController->activeScene()->views())
view->resetCachedContent();
}
}
void UBPreferencesController::setCrossColorOnLightBackground(const QColor& color)
{
UBSettings::settings()->boardCrossColorLightBackground->set(color.name(QColor::HexArgb));
mPreferencesUI->lightBackgroundOpacitySlider->setValue(color.alpha() * 100 / 255);
if (UBApplication::boardController && UBApplication::boardController->activeScene())
{
foreach(QGraphicsView* view, UBApplication::boardController->activeScene()->views())
view->resetCachedContent();
}
}
void UBPreferencesController::toolbarPositionChanged(bool checked)
{

@ -47,7 +47,6 @@ namespace Ui
class UBBrushPropertiesFrame;
class UBPreferencesDialog : public QDialog
{
Q_OBJECT;
@ -84,15 +83,21 @@ class UBPreferencesController : public QObject
Ui::preferencesDialog* mPreferencesUI;
UBBrushPropertiesFrame* mPenProperties;
UBBrushPropertiesFrame* mMarkerProperties;
UBColorPicker* mDarkBackgroundGridColorPicker;
UBColorPicker* mLightBackgroundGridColorPicker;
protected slots:
void close();
void defaultSettings();
void penPreviewFromSizeChanged(int value);
void darkBackgroundCrossOpacityValueChanged(int value);
void lightBackgroundCrossOpacityValueChanged(int value);
void widthSliderChanged(int value);
void opacitySliderChanged(int value);
void colorSelected(const QColor&);
void setCrossColorOnDarkBackground(const QColor& color);
void setCrossColorOnLightBackground(const QColor& color);
void toolbarPositionChanged(bool checked);
void toolbarOrientationVertical(bool checked);
void toolbarOrientationHorizontal(bool checked);
@ -122,5 +127,4 @@ class UBBrushPropertiesFrame : public Ui::brushProperties
};
#endif /* UBPREFERENCESCONTROLLER_H_ */

@ -105,13 +105,16 @@ UBColorListSetting::UBColorListSetting(UBSettings* owner, const QString& pDomain
: UBSetting(owner, pDomain, pKey, pDefaultValue)
, mAlpha(pAlpha)
{
foreach(QString s, get().toStringList())
{
QColor color;
color.setNamedColor(s);
if (mAlpha>=0)
color.setAlphaF(mAlpha);
mColors.append(color);
}
}
UBColorListSetting::~UBColorListSetting()
@ -129,7 +132,9 @@ QVariant UBColorListSetting::reset()
{
QColor color;
color.setNamedColor(s);
if (mAlpha>=0)
color.setAlphaF(mAlpha);
mColors.append(color);
}
@ -146,10 +151,15 @@ QList<QColor> UBColorListSetting::colors() const
void UBColorListSetting::setColor(int pIndex, const QColor& color)
{
QStringList list = get().toStringList();
list.replace(pIndex, color.name());
list.replace(pIndex, color.name(QColor::HexArgb));
if (mAlpha>=0)
{
QColor c = color;
c.setAlphaF(mAlpha);
mColors.replace(pIndex, c);
}
else
mColors.replace(pIndex, color);
set(list);
}

@ -286,10 +286,17 @@ void UBSettings::init()
pageSize = new UBSetting(this, "Board", "DefaultPageSize", documentSizes.value(DocumentSizeRatio::Ratio4_3));
boardCrossColorDarkBackground = new UBSetting(this, "Board", "CrossColorDarkBackground", "#C8C0C0C0");
boardCrossColorDarkBackground = new UBSetting(this, "Board", "CrossColorDarkBackground", "#C82C2C2C");
boardCrossColorLightBackground = new UBSetting(this, "Board", "CrossColorLightBackground", "#A5E1FF");
QStringList gridLightBackgroundColors;
gridLightBackgroundColors << "#FFFFFF" << "#FF3400" << "#66C0FF" << "#81FF5C" << "#FFFF00" << "#B68360" << "#FF497E" << "#8D69FF" << "#C82C2C2C";
boardGridLightBackgroundColors = new UBColorListSetting(this, "Board", "GridLightBackgroundColors", gridLightBackgroundColors, -1.0);
QStringList gridDarkBackgroundColors;
gridDarkBackgroundColors << "#000000" << "#FF0000" << "#004080" << "#008000" << "#FFDD00" << "#C87400" << "#800040" << "#008080" << "#A5E1FF";
boardGridDarkBackgroundColors = new UBColorListSetting(this, "Board", "GridDarkBackgroundColors", gridDarkBackgroundColors, -1.0);
QStringList penLightBackgroundColors;
penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#FFDD00" << "#C87400" << "#800040" << "#008080" << "#5F2D0A" << "#FFFFFF";
boardPenLightBackgroundColors = new UBColorListSetting(this, "Board", "PenLightBackgroundColors", penLightBackgroundColors, 1.0);

@ -294,6 +294,9 @@ class UBSettings : public QObject
UBSetting* boardCrossColorDarkBackground;
UBSetting* boardCrossColorLightBackground;
UBColorListSetting* boardGridLightBackgroundColors;
UBColorListSetting* boardGridDarkBackgroundColors;
UBColorListSetting* boardPenLightBackgroundColors;
UBColorListSetting* boardPenLightBackgroundSelectedColors;

Loading…
Cancel
Save