1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 01:33:50 +03:00

introduce thickness margin influence option

This commit is contained in:
Michail Vourlakos 2022-02-12 22:06:05 +02:00
parent b6a38e3830
commit 40b4851dac
8 changed files with 358 additions and 366 deletions

View File

@ -17,6 +17,7 @@ const bool Preferences::METAPRESSFORAPPLAUNCHER;
const bool Preferences::METAHOLDFORBADGES; const bool Preferences::METAHOLDFORBADGES;
const int Preferences::PARABOLICSPREAD; const int Preferences::PARABOLICSPREAD;
const int Preferences::SCREENSDELAY; const int Preferences::SCREENSDELAY;
const float Preferences::THICKNESSMARGININFLUENCE = 1.0f;
const Settings::MouseSensitivity Preferences::MOUSESENSITIVITY; const Settings::MouseSensitivity Preferences::MOUSESENSITIVITY;
Preferences::Preferences() Preferences::Preferences()
@ -34,6 +35,7 @@ Preferences::Preferences(Preferences &&o)
metaHoldForBadges(o.metaHoldForBadges), metaHoldForBadges(o.metaHoldForBadges),
mouseSensitivity(o.mouseSensitivity), mouseSensitivity(o.mouseSensitivity),
parabolicSpread(o.parabolicSpread), parabolicSpread(o.parabolicSpread),
thicknessMarginInfluence(o.thicknessMarginInfluence),
screensDelay(o.screensDelay) screensDelay(o.screensDelay)
{ {
} }
@ -49,6 +51,7 @@ Preferences::Preferences(const Preferences &o)
metaHoldForBadges(o.metaHoldForBadges), metaHoldForBadges(o.metaHoldForBadges),
mouseSensitivity(o.mouseSensitivity), mouseSensitivity(o.mouseSensitivity),
parabolicSpread(o.parabolicSpread), parabolicSpread(o.parabolicSpread),
thicknessMarginInfluence(o.thicknessMarginInfluence),
screensDelay(o.screensDelay) screensDelay(o.screensDelay)
{ {
} }
@ -65,6 +68,7 @@ Preferences &Preferences::operator=(const Preferences &rhs)
metaHoldForBadges = rhs.metaHoldForBadges; metaHoldForBadges = rhs.metaHoldForBadges;
mouseSensitivity = rhs.mouseSensitivity; mouseSensitivity = rhs.mouseSensitivity;
parabolicSpread = rhs.parabolicSpread; parabolicSpread = rhs.parabolicSpread;
thicknessMarginInfluence = rhs.thicknessMarginInfluence;
screensDelay = rhs.screensDelay; screensDelay = rhs.screensDelay;
return (*this); return (*this);
@ -82,6 +86,7 @@ Preferences &Preferences::operator=(Preferences &&rhs)
metaHoldForBadges = rhs.metaHoldForBadges; metaHoldForBadges = rhs.metaHoldForBadges;
mouseSensitivity = rhs.mouseSensitivity; mouseSensitivity = rhs.mouseSensitivity;
parabolicSpread = rhs.parabolicSpread; parabolicSpread = rhs.parabolicSpread;
thicknessMarginInfluence = rhs.thicknessMarginInfluence;
screensDelay = rhs.screensDelay; screensDelay = rhs.screensDelay;
return (*this); return (*this);
@ -99,6 +104,7 @@ bool Preferences::operator==(const Preferences &rhs) const
&& (metaHoldForBadges == rhs.metaHoldForBadges) && (metaHoldForBadges == rhs.metaHoldForBadges)
&& (mouseSensitivity == rhs.mouseSensitivity) && (mouseSensitivity == rhs.mouseSensitivity)
&& (parabolicSpread == rhs.parabolicSpread) && (parabolicSpread == rhs.parabolicSpread)
&& (thicknessMarginInfluence == rhs.thicknessMarginInfluence)
&& (screensDelay == rhs.screensDelay); && (screensDelay == rhs.screensDelay);
} }
@ -119,6 +125,7 @@ bool Preferences::inDefaultValues() const
&& (metaHoldForBadges == METAHOLDFORBADGES) && (metaHoldForBadges == METAHOLDFORBADGES)
&& (mouseSensitivity == MOUSESENSITIVITY) && (mouseSensitivity == MOUSESENSITIVITY)
&& (parabolicSpread == PARABOLICSPREAD) && (parabolicSpread == PARABOLICSPREAD)
&& (thicknessMarginInfluence == THICKNESSMARGININFLUENCE)
&& (screensDelay == SCREENSDELAY); && (screensDelay == SCREENSDELAY);
} }
@ -134,6 +141,7 @@ void Preferences::setToDefaults()
metaHoldForBadges = METAHOLDFORBADGES; metaHoldForBadges = METAHOLDFORBADGES;
mouseSensitivity = MOUSESENSITIVITY; mouseSensitivity = MOUSESENSITIVITY;
parabolicSpread = PARABOLICSPREAD; parabolicSpread = PARABOLICSPREAD;
thicknessMarginInfluence = THICKNESSMARGININFLUENCE;
screensDelay = SCREENSDELAY; screensDelay = SCREENSDELAY;
} }

View File

@ -28,6 +28,7 @@ public:
static const bool METAHOLDFORBADGES = true; static const bool METAHOLDFORBADGES = true;
static const int PARABOLICSPREAD = 3; static const int PARABOLICSPREAD = 3;
static const int SCREENSDELAY = 2500; static const int SCREENSDELAY = 2500;
static const float THICKNESSMARGININFLUENCE;
static const Settings::MouseSensitivity MOUSESENSITIVITY = Settings::HighMouseSensitivity; static const Settings::MouseSensitivity MOUSESENSITIVITY = Settings::HighMouseSensitivity;
Preferences(); Preferences();
@ -44,6 +45,7 @@ public:
bool metaHoldForBadges{METAHOLDFORBADGES}; bool metaHoldForBadges{METAHOLDFORBADGES};
int parabolicSpread{PARABOLICSPREAD}; int parabolicSpread{PARABOLICSPREAD};
int screensDelay{SCREENSDELAY}; int screensDelay{SCREENSDELAY};
float thicknessMarginInfluence{THICKNESSMARGININFLUENCE};
QStringList contextMenuAlwaysActions{Data::ContextMenu::ACTIONSALWAYSVISIBLE}; QStringList contextMenuAlwaysActions{Data::ContextMenu::ACTIONSALWAYSVISIBLE};
Settings::MouseSensitivity mouseSensitivity{MOUSESENSITIVITY}; Settings::MouseSensitivity mouseSensitivity{MOUSESENSITIVITY};

View File

@ -533,59 +533,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<layout class="QGridLayout" name="preferencesGridLayout" columnstretch="5,9"> <layout class="QGridLayout" name="preferencesGridLayout" columnstretch="5,0">
<item row="5" column="1">
<widget class="QCheckBox" name="broadcastGeomChkBox">
<property name="text">
<string>Inform Plasma desktop for available desktop space</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="noBordersForMaximizedChkBox">
<property name="toolTip">
<string>Activate support for borderless maximized windows between different layouts</string>
</property>
<property name="text">
<string>Support borderless maximized windows in different layouts</string>
</property>
</widget>
</item>
<item row="17" column="0">
<layout class="QHBoxLayout" name="plasmaThemeHeaderRowLayout"/>
</item>
<item row="14" column="1">
<spacer name="verticalSpacer_14">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="16" column="1">
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QCheckBox" name="infoWindowChkBox"> <widget class="QCheckBox" name="infoWindowChkBox">
<property name="toolTip"> <property name="toolTip">
@ -596,39 +544,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="10" column="0">
<spacer name="verticalSpacer_6"> <layout class="QHBoxLayout" name="parabolicHeaderRowLayout">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="17" column="1">
<layout class="QHBoxLayout" name="plasmaThemeRowLayout"/>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="metaPressHoldChkBox">
<property name="toolTip">
<string>Press and hold ⌘ to show shortcuts badges for applets and tasks</string>
</property>
<property name="text">
<string>Press and Hold ⌘ to show shortcuts badges</string>
</property>
</widget>
</item>
<item row="15" column="0">
<layout class="QHBoxLayout" name="screensHeaderRowLayout">
<item> <item>
<spacer name="horizontalSpacer_8"> <spacer name="horizontalSpacer_7">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -641,7 +560,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLabel" name="screensLbl"> <widget class="QLabel" name="parabolicEffectLbl">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -649,7 +568,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Screens:</string> <string>Parabolic Effect:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -658,59 +577,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="7" column="1"> <item row="10" column="1">
<widget class="QCheckBox" name="metaPressChkBox">
<property name="toolTip">
<string>Forward ⌘ press from KWin to Latte in order to activate Application Launcher. It is suggested to disable that option if you remove Latte.</string>
</property>
<property name="text">
<string>Press ⌘ to activate Application Launcher</string>
</property>
</widget>
</item>
<item row="13" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="contextMenuActionsBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Actions...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="11" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QToolButton" name="smallParabolicBtn"> <widget class="QToolButton" name="smallParabolicBtn">
@ -818,10 +685,143 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="13" column="0"> <item row="20" column="0">
<layout class="QHBoxLayout" name="contextMenuRowLayout"> <layout class="QHBoxLayout" name="plasmaThemeHeaderRowLayout"/>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="15" column="1">
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="autostartChkBox">
<property name="toolTip">
<string>Start the application automatically after each relogin</string>
</property>
<property name="text">
<string>Enable autostart during startup</string>
</property>
</widget>
</item>
<item row="17" column="1">
<spacer name="verticalSpacer_14">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="metaPressHoldChkBox">
<property name="toolTip">
<string>Press and hold ⌘ to show shortcuts badges for applets and tasks</string>
</property>
<property name="text">
<string>Press and Hold ⌘ to show shortcuts badges</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="badges3DStyleChkBox">
<property name="text">
<string>Use 3D style for notification and shortcut badges</string>
</property>
</widget>
</item>
<item row="12" column="1">
<layout class="QHBoxLayout" name="marginInfluenceRowLayout">
<item> <item>
<spacer name="horizontalSpacer_10"> <widget class="QPushButton" name="noMarginInfluenceBtn">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">0%</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="halfMarginInfluenceBtn">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">50%</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="fullMarginInfluenceBtn">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string notr="true">100%</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="marginInfluenceLbl">
<property name="text">
<string notr="true">thickness margin influence</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -833,15 +833,15 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="contextMenuLbl">
<property name="text">
<string>Context Menu:</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="5" column="1">
<widget class="QCheckBox" name="broadcastGeomChkBox">
<property name="text">
<string>Inform Plasma desktop for available desktop space</string>
</property>
</widget>
</item>
<item row="3" column="0"> <item row="3" column="0">
<layout class="QHBoxLayout" name="behaviorHeaderRowLayout"> <layout class="QHBoxLayout" name="behaviorHeaderRowLayout">
<item> <item>
@ -875,124 +875,44 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="10" column="1"> <item row="2" column="1">
<layout class="QHBoxLayout" name="mouseSensitivityRowLayout"> <spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="16" column="0">
<layout class="QHBoxLayout" name="contextMenuRowLayout">
<item> <item>
<widget class="QToolButton" name="lowSensitivityBtn"> <spacer name="horizontalSpacer_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Low sensitivity for parabolic effect (low cpu usage and performance)</string>
</property>
<property name="text">
<string comment="low sensitivity">Low</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mediumSensitivityBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Medium sensitivity for parabolic effect (normal cpu usage and performance)</string>
</property>
<property name="text">
<string comment="medium sensitivity">Medium</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="highSensitivityBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>High sensitivity for parabolic effect (high cpu usage and performance)</string>
</property>
<property name="text">
<string comment="high sensitivity">High</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="mouseSensitivityLbl">
<property name="text">
<string>mouse sensitivity</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>60</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="contextMenuLbl">
<property name="text">
<string>Context Menu:</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="7" column="0"> <item row="7" column="0">
@ -1022,7 +942,82 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="15" column="1"> <item row="16" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="contextMenuActionsBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Actions...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="18" column="0">
<layout class="QHBoxLayout" name="screensHeaderRowLayout">
<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="QLabel" name="screensLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Screens:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="18" column="1">
<layout class="QHBoxLayout" name="screenDelayRowLayout"> <layout class="QHBoxLayout" name="screenDelayRowLayout">
<item> <item>
<widget class="QSpinBox" name="screenTrackerSpinBox"> <widget class="QSpinBox" name="screenTrackerSpinBox">
@ -1106,85 +1101,13 @@ This tracker is used in order to not lose any screen related update.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="10" column="0"> <item row="4" column="1">
<layout class="QHBoxLayout" name="parabolicHeaderRowLayout"> <widget class="QCheckBox" name="noBordersForMaximizedChkBox">
<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="QLabel" name="parabolicEffectLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Parabolic Effect:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="1">
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="badges3DStyleChkBox">
<property name="text">
<string>Use 3D style for notification and shortcut badges</string>
</property>
</widget>
</item>
<item row="6" column="1">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="autostartChkBox">
<property name="toolTip"> <property name="toolTip">
<string>Start the application automatically after each relogin</string> <string>Activate support for borderless maximized windows between different layouts</string>
</property> </property>
<property name="text"> <property name="text">
<string>Enable autostart during startup</string> <string>Support borderless maximized windows in different layouts</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -1215,8 +1138,8 @@ This tracker is used in order to not lose any screen related update.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="12" column="1"> <item row="9" column="1">
<spacer name="verticalSpacer_9"> <spacer name="verticalSpacer_8">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
@ -1231,6 +1154,35 @@ This tracker is used in order to not lose any screen related update.</string>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="20" column="1">
<layout class="QHBoxLayout" name="plasmaThemeRowLayout"/>
</item>
<item row="19" column="1">
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="metaPressChkBox">
<property name="toolTip">
<string>Forward ⌘ press from KWin to Latte in order to activate Application Launcher. It is suggested to disable that option if you remove Latte.</string>
</property>
<property name="text">
<string>Press ⌘ to activate Application Launcher</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

View File

@ -34,30 +34,26 @@ TabPreferences::TabPreferences(Latte::Settings::Dialog::SettingsDialog *parent)
void TabPreferences::initUi() void TabPreferences::initUi()
{ {
//! exclusive groups //! exclusive groups
m_mouseSensitivityButtons = new QButtonGroup(this);
m_mouseSensitivityButtons->addButton(m_ui->lowSensitivityBtn, Latte::Settings::LowMouseSensitivity);
m_mouseSensitivityButtons->addButton(m_ui->mediumSensitivityBtn, Latte::Settings::MediumMouseSensitivity);
m_mouseSensitivityButtons->addButton(m_ui->highSensitivityBtn, Latte::Settings::HighMouseSensitivity);
m_mouseSensitivityButtons->setExclusive(true);
m_parabolicSpreadButtons = new QButtonGroup(this); m_parabolicSpreadButtons = new QButtonGroup(this);
m_parabolicSpreadButtons->addButton(m_ui->smallParabolicBtn, Data::Preferences::PARABOLICSPREAD); m_parabolicSpreadButtons->addButton(m_ui->smallParabolicBtn, Data::Preferences::PARABOLICSPREAD);
m_parabolicSpreadButtons->addButton(m_ui->mediumParabolicBtn, 5); m_parabolicSpreadButtons->addButton(m_ui->mediumParabolicBtn, 5);
m_parabolicSpreadButtons->addButton(m_ui->largeParabolicBtn, 7); m_parabolicSpreadButtons->addButton(m_ui->largeParabolicBtn, 7);
m_parabolicSpreadButtons->setExclusive(true); m_parabolicSpreadButtons->setExclusive(true);
m_thicknessMarginInfluenceButtons = new QButtonGroup(this);
m_thicknessMarginInfluenceButtons->addButton(m_ui->noMarginInfluenceBtn, 0); // 0%
m_thicknessMarginInfluenceButtons->addButton(m_ui->halfMarginInfluenceBtn, 50); // 50%
m_thicknessMarginInfluenceButtons->addButton(m_ui->fullMarginInfluenceBtn, 100); // 100%
m_thicknessMarginInfluenceButtons->setExclusive(true);
m_ui->noMarginInfluenceBtn->setText(i18nc("number in percentage, e.g. 85%","%1%").arg(0));
m_ui->halfMarginInfluenceBtn->setText(i18nc("number in percentage, e.g. 85%","%1%").arg(50));
m_ui->fullMarginInfluenceBtn->setText(i18nc("number in percentage, e.g. 85%","%1%").arg(100));
//! Buttons //! Buttons
connect(m_ui->contextMenuActionsBtn, &QPushButton::clicked, this, &TabPreferences::onActionsBtnPressed); connect(m_ui->contextMenuActionsBtn, &QPushButton::clicked, this, &TabPreferences::onActionsBtnPressed);
//! signals //! signals
connect(m_mouseSensitivityButtons, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled),
[ = ](int id, bool checked) {
if (checked) {
m_preferences.mouseSensitivity = static_cast<Latte::Settings::MouseSensitivity>(id);
emit dataChanged();
}
});
connect(m_parabolicSpreadButtons, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled), connect(m_parabolicSpreadButtons, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled),
[ = ](int id, bool checked) { [ = ](int id, bool checked) {
if (checked) { if (checked) {
@ -66,6 +62,14 @@ void TabPreferences::initUi()
} }
}); });
connect(m_thicknessMarginInfluenceButtons, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled),
[ = ](int id, bool checked) {
if (checked) {
m_preferences.thicknessMarginInfluence = (id / 100.0f);
emit dataChanged();
}
});
connect(m_ui->screenTrackerSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [ = ](int i) { connect(m_ui->screenTrackerSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [ = ](int i) {
m_preferences.screensDelay = m_ui->screenTrackerSpinBox->value(); m_preferences.screensDelay = m_ui->screenTrackerSpinBox->value();
emit dataChanged(); emit dataChanged();
@ -124,8 +128,8 @@ void TabPreferences::initSettings()
o_preferences.metaPressForAppLauncher = m_corona->universalSettings()->kwin_metaForwardedToLatte(); o_preferences.metaPressForAppLauncher = m_corona->universalSettings()->kwin_metaForwardedToLatte();
o_preferences.metaHoldForBadges = m_corona->universalSettings()->metaPressAndHoldEnabled(); o_preferences.metaHoldForBadges = m_corona->universalSettings()->metaPressAndHoldEnabled();
o_preferences.borderlessMaximized = m_corona->universalSettings()->canDisableBorders(); o_preferences.borderlessMaximized = m_corona->universalSettings()->canDisableBorders();
o_preferences.mouseSensitivity = m_corona->universalSettings()->sensitivity();
o_preferences.parabolicSpread = m_corona->universalSettings()->parabolicSpread(); o_preferences.parabolicSpread = m_corona->universalSettings()->parabolicSpread();
o_preferences.thicknessMarginInfluence = m_corona->universalSettings()->thicknessMarginInfluence();
o_preferences.screensDelay = m_corona->universalSettings()->screenTrackerInterval(); o_preferences.screensDelay = m_corona->universalSettings()->screenTrackerInterval();
m_preferences = o_preferences; m_preferences = o_preferences;
@ -160,14 +164,6 @@ void TabPreferences::updateUi()
m_ui->noBordersForMaximizedChkBox->setChecked(m_preferences.borderlessMaximized); m_ui->noBordersForMaximizedChkBox->setChecked(m_preferences.borderlessMaximized);
m_ui->screenTrackerSpinBox->setValue(m_preferences.screensDelay); m_ui->screenTrackerSpinBox->setValue(m_preferences.screensDelay);
if (m_preferences.mouseSensitivity == Settings::LowMouseSensitivity) {
m_ui->lowSensitivityBtn->setChecked(true);
} else if (m_preferences.mouseSensitivity == Settings::MediumMouseSensitivity) {
m_ui->mediumSensitivityBtn->setChecked(true);
} else if (m_preferences.mouseSensitivity == Settings::HighMouseSensitivity) {
m_ui->highSensitivityBtn->setChecked(true);
}
if (m_preferences.parabolicSpread == Data::Preferences::PARABOLICSPREAD) { if (m_preferences.parabolicSpread == Data::Preferences::PARABOLICSPREAD) {
m_ui->smallParabolicBtn->setChecked(true); m_ui->smallParabolicBtn->setChecked(true);
} else if (m_preferences.parabolicSpread == 5) { } else if (m_preferences.parabolicSpread == 5) {
@ -176,6 +172,14 @@ void TabPreferences::updateUi()
m_ui->largeParabolicBtn->setChecked(true); m_ui->largeParabolicBtn->setChecked(true);
} }
if (m_preferences.thicknessMarginInfluence == 0.0f) {
m_ui->noMarginInfluenceBtn->setChecked(true);
} else if (m_preferences.thicknessMarginInfluence == 0.5f) {
m_ui->halfMarginInfluenceBtn->setChecked(true);
} else if (m_preferences.thicknessMarginInfluence == Data::Preferences::THICKNESSMARGININFLUENCE) {
m_ui->fullMarginInfluenceBtn->setChecked(true);
}
emit dataChanged(); emit dataChanged();
} }
@ -209,7 +213,6 @@ void TabPreferences::resetDefaults()
void TabPreferences::save() void TabPreferences::save()
{ {
m_corona->universalSettings()->setSensitivity(m_preferences.mouseSensitivity);
m_corona->universalSettings()->setAutostart(m_preferences.autostart); m_corona->universalSettings()->setAutostart(m_preferences.autostart);
m_corona->universalSettings()->setBadges3DStyle(m_preferences.badgeStyle3D); m_corona->universalSettings()->setBadges3DStyle(m_preferences.badgeStyle3D);
m_corona->universalSettings()->setContextMenuActionsAlwaysShown(m_preferences.contextMenuAlwaysActions); m_corona->universalSettings()->setContextMenuActionsAlwaysShown(m_preferences.contextMenuAlwaysActions);
@ -219,6 +222,7 @@ void TabPreferences::save()
m_corona->universalSettings()->setShowInfoWindow(m_preferences.layoutsInformationWindow); m_corona->universalSettings()->setShowInfoWindow(m_preferences.layoutsInformationWindow);
m_corona->universalSettings()->setCanDisableBorders(m_preferences.borderlessMaximized); m_corona->universalSettings()->setCanDisableBorders(m_preferences.borderlessMaximized);
m_corona->universalSettings()->setParabolicSpread(m_preferences.parabolicSpread); m_corona->universalSettings()->setParabolicSpread(m_preferences.parabolicSpread);
m_corona->universalSettings()->setThicknessMarginInfluence(m_preferences.thicknessMarginInfluence);
m_corona->universalSettings()->setScreenTrackerInterval(m_preferences.screensDelay); m_corona->universalSettings()->setScreenTrackerInterval(m_preferences.screensDelay);
o_preferences = m_preferences; o_preferences = m_preferences;

View File

@ -69,8 +69,8 @@ private:
Ui::SettingsDialog *m_ui{nullptr}; Ui::SettingsDialog *m_ui{nullptr};
Latte::Corona *m_corona{nullptr}; Latte::Corona *m_corona{nullptr};
QButtonGroup *m_mouseSensitivityButtons;
QButtonGroup *m_parabolicSpreadButtons; QButtonGroup *m_parabolicSpreadButtons;
QButtonGroup *m_thicknessMarginInfluenceButtons;
//! current data //! current data
Data::Preferences m_preferences; Data::Preferences m_preferences;

View File

@ -55,6 +55,7 @@ UniversalSettings::UniversalSettings(KSharedConfig::Ptr config, QObject *parent)
connect(this, &UniversalSettings::screenTrackerIntervalChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::screenTrackerIntervalChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::showInfoWindowChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::showInfoWindowChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::singleModeLayoutNameChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::singleModeLayoutNameChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::thicknessMarginInfluenceChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::versionChanged, this, &UniversalSettings::saveConfig); connect(this, &UniversalSettings::versionChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::screenScalesChanged, this, &UniversalSettings::saveScalesConfig); connect(this, &UniversalSettings::screenScalesChanged, this, &UniversalSettings::saveScalesConfig);
@ -209,6 +210,21 @@ void UniversalSettings::setParabolicSpread(const int &spread)
emit parabolicSpreadChanged(); emit parabolicSpreadChanged();
} }
float UniversalSettings::thicknessMarginInfluence() const
{
return m_thicknessMarginInfluence;
}
void UniversalSettings::setThicknessMarginInfluence(const float &influence)
{
if (m_thicknessMarginInfluence == influence) {
return;
}
m_thicknessMarginInfluence = influence;
emit thicknessMarginInfluenceChanged();
}
QString UniversalSettings::singleModeLayoutName() const QString UniversalSettings::singleModeLayoutName() const
{ {
return m_singleModeLayoutName; return m_singleModeLayoutName;
@ -450,7 +466,9 @@ void UniversalSettings::setLayoutsMemoryUsage(MemoryUsage::LayoutsMemory layouts
Settings::MouseSensitivity UniversalSettings::sensitivity() Settings::MouseSensitivity UniversalSettings::sensitivity()
{ {
return m_sensitivity; //! return always default option as the users have not shown any interest in that option
return Latte::Settings::HighMouseSensitivity;
// return m_sensitivity;
} }
void UniversalSettings::setSensitivity(Settings::MouseSensitivity sense) void UniversalSettings::setSensitivity(Settings::MouseSensitivity sense)
@ -460,7 +478,7 @@ void UniversalSettings::setSensitivity(Settings::MouseSensitivity sense)
} }
m_sensitivity = sense; m_sensitivity = sense;
emit sensitivityChanged(); // emit sensitivityChanged();
} }
float UniversalSettings::screenWidthScale(QString screenName) const float UniversalSettings::screenWidthScale(QString screenName) const
@ -544,8 +562,9 @@ void UniversalSettings::loadConfig()
m_showInfoWindow = m_universalGroup.readEntry("showInfoWindow", true); m_showInfoWindow = m_universalGroup.readEntry("showInfoWindow", true);
m_singleModeLayoutName = m_universalGroup.readEntry("singleModeLayoutName", QString()); m_singleModeLayoutName = m_universalGroup.readEntry("singleModeLayoutName", QString());
m_parabolicSpread = m_universalGroup.readEntry("parabolicSpread", Data::Preferences::PARABOLICSPREAD); m_parabolicSpread = m_universalGroup.readEntry("parabolicSpread", Data::Preferences::PARABOLICSPREAD);
m_thicknessMarginInfluence = m_universalGroup.readEntry("parabolicThicknessMarginInfluence", Data::Preferences::THICKNESSMARGININFLUENCE);
m_memoryUsage = static_cast<MemoryUsage::LayoutsMemory>(m_universalGroup.readEntry("memoryUsage", (int)MemoryUsage::SingleLayout)); m_memoryUsage = static_cast<MemoryUsage::LayoutsMemory>(m_universalGroup.readEntry("memoryUsage", (int)MemoryUsage::SingleLayout));
m_sensitivity = static_cast<Settings::MouseSensitivity>(m_universalGroup.readEntry("mouseSensitivity", (int)Settings::HighMouseSensitivity)); //m_sensitivity = static_cast<Settings::MouseSensitivity>(m_universalGroup.readEntry("mouseSensitivity", (int)Settings::HighMouseSensitivity));
loadScalesConfig(); loadScalesConfig();
@ -568,8 +587,9 @@ void UniversalSettings::saveConfig()
m_universalGroup.writeEntry("showInfoWindow", m_showInfoWindow); m_universalGroup.writeEntry("showInfoWindow", m_showInfoWindow);
m_universalGroup.writeEntry("singleModeLayoutName", m_singleModeLayoutName); m_universalGroup.writeEntry("singleModeLayoutName", m_singleModeLayoutName);
m_universalGroup.writeEntry("parabolicSpread", m_parabolicSpread); m_universalGroup.writeEntry("parabolicSpread", m_parabolicSpread);
m_universalGroup.writeEntry("parabolicThicknessMarginInfluence", m_thicknessMarginInfluence);
m_universalGroup.writeEntry("memoryUsage", (int)m_memoryUsage); m_universalGroup.writeEntry("memoryUsage", (int)m_memoryUsage);
m_universalGroup.writeEntry("mouseSensitivity", (int)m_sensitivity); //m_universalGroup.writeEntry("mouseSensitivity", (int)m_sensitivity);
syncSettings(); syncSettings();
} }

View File

@ -49,6 +49,7 @@ class UniversalSettings : public QObject
Q_PROPERTY(bool showInfoWindow READ showInfoWindow WRITE setShowInfoWindow NOTIFY showInfoWindowChanged) Q_PROPERTY(bool showInfoWindow READ showInfoWindow WRITE setShowInfoWindow NOTIFY showInfoWindowChanged)
Q_PROPERTY(int parabolicSpread READ parabolicSpread WRITE setParabolicSpread NOTIFY parabolicSpreadChanged) Q_PROPERTY(int parabolicSpread READ parabolicSpread WRITE setParabolicSpread NOTIFY parabolicSpreadChanged)
Q_PROPERTY(float thicknessMarginInfluence READ thicknessMarginInfluence WRITE setThicknessMarginInfluence NOTIFY thicknessMarginInfluenceChanged)
Q_PROPERTY(QString singleModeLayoutName READ singleModeLayoutName WRITE setSingleModeLayoutName NOTIFY singleModeLayoutNameChanged) Q_PROPERTY(QString singleModeLayoutName READ singleModeLayoutName WRITE setSingleModeLayoutName NOTIFY singleModeLayoutNameChanged)
@ -103,6 +104,9 @@ public:
int screenTrackerInterval() const; int screenTrackerInterval() const;
void setScreenTrackerInterval(int duration); void setScreenTrackerInterval(int duration);
float thicknessMarginInfluence() const;
void setThicknessMarginInfluence(const float &influence);
QString singleModeLayoutName() const; QString singleModeLayoutName() const;
void setSingleModeLayoutName(QString layoutName); void setSingleModeLayoutName(QString layoutName);
@ -151,6 +155,7 @@ signals:
void screenTrackerIntervalChanged(); void screenTrackerIntervalChanged();
void showInfoWindowChanged(); void showInfoWindowChanged();
void singleModeLayoutNameChanged(); void singleModeLayoutNameChanged();
void thicknessMarginInfluenceChanged();
void versionChanged(); void versionChanged();
private slots: private slots:
@ -190,6 +195,7 @@ private:
int m_screenTrackerInterval{2500}; int m_screenTrackerInterval{2500};
int m_parabolicSpread{Data::Preferences::PARABOLICSPREAD}; int m_parabolicSpread{Data::Preferences::PARABOLICSPREAD};
float m_thicknessMarginInfluence{Data::Preferences::THICKNESSMARGININFLUENCE};
QString m_singleModeLayoutName; QString m_singleModeLayoutName;

View File

@ -24,7 +24,7 @@ Ability.ParabolicEffectPrivate {
return (maxSize/metrics.iconSize); return (maxSize/metrics.iconSize);
} }
factor.maxZoom: Math.max(factor.zoom, animations.requirements.zoomFactor) factor.maxZoom: Math.max(factor.zoom, animations.requirements.zoomFactor)
factor.marginThicknessZoomInPercentage: 1.0 //100% factor.marginThicknessZoomInPercentage: settings ? settings.thicknessMarginInfluence : 1.0 //100%
restoreZoomIsBlocked: restoreZoomIsBlockedFromApplet || (view && view.contextMenuIsShown) restoreZoomIsBlocked: restoreZoomIsBlockedFromApplet || (view && view.contextMenuIsShown)
spread: settings ? settings.parabolicSpread : 3 spread: settings ? settings.parabolicSpread : 3