Commit 5d3d6cde authored by Florian Bruhin's avatar Florian Bruhin Committed by Albert Astals Cid
Browse files

Make color opacity configurable

parent 645d8e81
......@@ -90,6 +90,16 @@ QColor PreferencesProxy::fingerColor(int index)
return Preferences::fingerColor(index);
}
double PreferencesProxy::fingerOpacity() const
{
return Preferences::fingerOpacity();
}
void PreferencesProxy::setFingerOpacity(double alpha)
{
Preferences::setFingerOpacity(alpha);
}
void PreferencesProxy::writeConfig()
{
Preferences::self()->save();
......
......@@ -21,6 +21,7 @@ class PreferencesProxy : public QObject
Q_PROPERTY(int requiredStrokesPerMinute READ requiredStrokesPerMinute WRITE setRequiredStrokesPerMinute NOTIFY configChanged)
Q_PROPERTY(double requiredAccuracy READ requiredAccuracy WRITE setRequiredAccuracy NOTIFY configChanged)
Q_PROPERTY(int lastUsedProfileId READ lastUsedProfileId WRITE setLastUsedProfileId NOTIFY configChanged)
Q_PROPERTY(double fingerOpacity READ fingerOpacity WRITE setFingerOpacity NOTIFY configChanged)
public:
explicit PreferencesProxy(QObject* parent = 0);
......@@ -36,6 +37,8 @@ public:
void setRequiredStrokesPerMinute(int strokesPerMinute);
double requiredAccuracy() const;
void setRequiredAccuracy(double accuracy);
double fingerOpacity() const;
void setFingerOpacity(double alpha);
int lastUsedProfileId() const;
void setLastUsedProfileId(int profileId);
Q_INVOKABLE QColor fingerColor(int index);
......
......@@ -57,6 +57,12 @@
<default param="6">#0000ff</default>
<default param="7">#ff0000</default>
</entry>
<entry name="FingerOpacity" type="Double">
<label>How transparent finger colors should be shown.</label>
<default>12.5</default>
<min>0</min>
<max>100</max>
</entry>
</group>
<group name="Session">
<entry name="LastUsedProfileId" type="Int">
......
......@@ -65,7 +65,7 @@ Item {
}
function getTint(color) {
color.a = 0.125
color.a = preferences.fingerOpacity / 100;
return color
}
......
......@@ -309,6 +309,42 @@
</property>
</spacer>
</item>
<item>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="opacityLabel">
<property name="text">
<string>Opacity</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_FingerOpacity</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="kcfg_FingerOpacity">
<property name="suffix">
<string> %</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment