provide ParabolicEffect spread option

--this way the user can choose to use a much
greater parabolic effect that will influence five
or seven of its neighbours instead of just three.
The new option can be found at Latte Global Preferences.
work/m_edgeslide
Michail Vourlakos 3 years ago
parent 78b124e8f4
commit b1c3594367

@ -15,6 +15,7 @@ const bool Preferences::BORDERLESSMAXIMIZED;
const bool Preferences::ISAVAILABLEGEOMETRYBROADCASTEDTOPLASMA;
const bool Preferences::METAPRESSFORAPPLAUNCHER;
const bool Preferences::METAHOLDFORBADGES;
const int Preferences::PARABOLICSPREAD;
const int Preferences::SCREENSDELAY;
const Settings::MouseSensitivity Preferences::MOUSESENSITIVITY;
@ -32,6 +33,7 @@ Preferences::Preferences(Preferences &&o)
metaPressForAppLauncher(o.metaPressForAppLauncher),
metaHoldForBadges(o.metaHoldForBadges),
mouseSensitivity(o.mouseSensitivity),
parabolicSpread(o.parabolicSpread),
screensDelay(o.screensDelay)
{
}
@ -46,6 +48,7 @@ Preferences::Preferences(const Preferences &o)
metaPressForAppLauncher(o.metaPressForAppLauncher),
metaHoldForBadges(o.metaHoldForBadges),
mouseSensitivity(o.mouseSensitivity),
parabolicSpread(o.parabolicSpread),
screensDelay(o.screensDelay)
{
}
@ -61,6 +64,7 @@ Preferences &Preferences::operator=(const Preferences &rhs)
metaPressForAppLauncher = rhs.metaPressForAppLauncher;
metaHoldForBadges = rhs.metaHoldForBadges;
mouseSensitivity = rhs.mouseSensitivity;
parabolicSpread = rhs.parabolicSpread;
screensDelay = rhs.screensDelay;
return (*this);
@ -77,6 +81,7 @@ Preferences &Preferences::operator=(Preferences &&rhs)
metaPressForAppLauncher = rhs.metaPressForAppLauncher;
metaHoldForBadges = rhs.metaHoldForBadges;
mouseSensitivity = rhs.mouseSensitivity;
parabolicSpread = rhs.parabolicSpread;
screensDelay = rhs.screensDelay;
return (*this);
@ -93,6 +98,7 @@ bool Preferences::operator==(const Preferences &rhs) const
&& (metaPressForAppLauncher == rhs.metaPressForAppLauncher)
&& (metaHoldForBadges == rhs.metaHoldForBadges)
&& (mouseSensitivity == rhs.mouseSensitivity)
&& (parabolicSpread == rhs.parabolicSpread)
&& (screensDelay == rhs.screensDelay);
}
@ -112,6 +118,7 @@ bool Preferences::inDefaultValues() const
&& (metaPressForAppLauncher == METAPRESSFORAPPLAUNCHER)
&& (metaHoldForBadges == METAHOLDFORBADGES)
&& (mouseSensitivity == MOUSESENSITIVITY)
&& (parabolicSpread == PARABOLICSPREAD)
&& (screensDelay == SCREENSDELAY);
}
@ -126,6 +133,7 @@ void Preferences::setToDefaults()
metaPressForAppLauncher = METAPRESSFORAPPLAUNCHER;
metaHoldForBadges = METAHOLDFORBADGES;
mouseSensitivity = MOUSESENSITIVITY;
parabolicSpread = PARABOLICSPREAD;
screensDelay = SCREENSDELAY;
}

@ -26,6 +26,7 @@ public:
static const bool ISAVAILABLEGEOMETRYBROADCASTEDTOPLASMA = true;
static const bool METAPRESSFORAPPLAUNCHER = false;
static const bool METAHOLDFORBADGES = true;
static const int PARABOLICSPREAD = 3;
static const int SCREENSDELAY = 2500;
static const Settings::MouseSensitivity MOUSESENSITIVITY = Settings::HighMouseSensitivity;
@ -41,6 +42,7 @@ public:
bool isAvailableGeometryBroadcastedToPlasma{ISAVAILABLEGEOMETRYBROADCASTEDTOPLASMA};
bool metaPressForAppLauncher{METAPRESSFORAPPLAUNCHER};
bool metaHoldForBadges{METAHOLDFORBADGES};
int parabolicSpread{PARABOLICSPREAD};
int screensDelay{SCREENSDELAY};
QStringList contextMenuAlwaysActions{Data::ContextMenu::ACTIONSALWAYSVISIBLE};
Settings::MouseSensitivity mouseSensitivity{MOUSESENSITIVITY};

@ -522,7 +522,7 @@
<x>0</x>
<y>0</y>
<width>1068</width>
<height>428</height>
<height>469</height>
</rect>
</property>
<property name="sizePolicy">
@ -534,102 +534,28 @@
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QGridLayout" name="preferencesGridLayout" columnstretch="5,9">
<item row="15" column="1">
<layout class="QHBoxLayout" name="screenDelayRowLayout">
<item>
<widget class="QSpinBox" name="screenTrackerSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Different hardware can have different delays during screen changes.
This tracker is used in order to not lose any screen related update.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="specialValueText">
<string/>
</property>
<property name="suffix">
<string> ms.</string>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>2500</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="trackScreensDelayLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Different hardware can have different delays during screen changes.
This tracker is used in order to not lose any screen related update.</string>
</property>
<property name="text">
<string>reaction delay for changes</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
<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="2" column="1">
<widget class="QCheckBox" name="infoWindowChkBox">
<item row="4" column="1">
<widget class="QCheckBox" name="noBordersForMaximizedChkBox">
<property name="toolTip">
<string>Provide visual feedback when layouts are activated automatically</string>
<string>Activate support for borderless maximized windows between different layouts</string>
</property>
<property name="text">
<string>Show informative window for layouts automatic activation</string>
<string>Support borderless maximized windows in different layouts</string>
</property>
</widget>
</item>
<item row="7" column="1">
<spacer name="verticalSpacer_7">
<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>
@ -644,8 +570,8 @@ This tracker is used in order to not lose any screen related update.</string>
</property>
</spacer>
</item>
<item row="14" column="1">
<spacer name="verticalSpacer_14">
<item row="16" column="1">
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -660,55 +586,18 @@ This tracker is used in order to not lose any screen related update.</string>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="noBordersForMaximizedChkBox">
<item row="1" column="1">
<widget class="QCheckBox" name="infoWindowChkBox">
<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>
<string>Provide visual feedback when layouts are activated automatically</string>
</property>
</widget>
</item>
<item row="8" column="0">
<layout class="QHBoxLayout" name="actionsHeaderRowLayout">
<item>
<spacer name="horizontalSpacer_6">
<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="actionsLbl">
<property name="text">
<string>Actions:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="badges3DStyleChkBox">
<property name="text">
<string>Use 3D style for notification and shortcut badges</string>
<string>Show informative window for layouts automatic activation</string>
</property>
</widget>
</item>
<item row="17" column="0">
<layout class="QHBoxLayout" name="plasmaThemeHeaderRowLayout"/>
</item>
<item row="12" column="1">
<spacer name="verticalSpacer_9">
<item row="2" column="1">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -723,7 +612,10 @@ This tracker is used in order to not lose any screen related update.</string>
</property>
</spacer>
</item>
<item row="9" column="1">
<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>
@ -733,26 +625,10 @@ This tracker is used in order to not lose any screen related update.</string>
</property>
</widget>
</item>
<item row="3" column="1">
<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="11" column="0">
<layout class="QHBoxLayout" name="parabolicHeaderRowLayout">
<item row="15" column="0">
<layout class="QHBoxLayout" name="screensHeaderRowLayout">
<item>
<spacer name="horizontalSpacer_7">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -765,7 +641,7 @@ This tracker is used in order to not lose any screen related update.</string>
</spacer>
</item>
<item>
<widget class="QLabel" name="parabolicEffectLbl">
<widget class="QLabel" name="screensLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -773,7 +649,7 @@ This tracker is used in order to not lose any screen related update.</string>
</sizepolicy>
</property>
<property name="text">
<string>Parabolic Effect:</string>
<string>Screens:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -782,10 +658,45 @@ This tracker is used in order to not lose any screen related update.</string>
</item>
</layout>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="behaviorHeaderRowLayout">
<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>
<item row="13" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<spacer name="horizontalSpacer_5">
<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>
@ -797,28 +708,120 @@ This tracker is used in order to not lose any screen related update.</string>
</property>
</spacer>
</item>
</layout>
</item>
<item row="11" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="behaviorLbl">
<widget class="QToolButton" name="smallParabolicBtn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<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="text">
<string comment="small spread">Small</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mediumParabolicBtn">
<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="text">
<string>Behavior:</string>
<string comment="medium spread">Medium</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="largeParabolicBtn">
<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="text">
<string comment="large spread">Large</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="parabolicSpreadLbl">
<property name="text">
<string>spread</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<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="15" column="0">
<layout class="QHBoxLayout" name="screensHeaderRowLayout">
<item row="13" column="0">
<layout class="QHBoxLayout" name="contextMenuRowLayout">
<item>
<spacer name="horizontalSpacer_8">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -831,53 +834,48 @@ This tracker is used in order to not lose any screen related update.</string>
</spacer>
</item>
<item>
<widget class="QLabel" name="screensLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QLabel" name="contextMenuLbl">
<property name="text">
<string>Screens:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<string>Context Menu:</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="17" column="1">
<layout class="QHBoxLayout" name="plasmaThemeRowLayout"/>
</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="4" 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 row="3" column="0">
<layout class="QHBoxLayout" name="behaviorHeaderRowLayout">
<item>
<spacer name="horizontalSpacer_5">
<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="behaviorLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Behavior:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="11" column="1">
<item row="10" column="1">
<layout class="QHBoxLayout" name="mouseSensitivityRowLayout">
<item>
<widget class="QToolButton" name="lowSensitivityBtn">
@ -997,26 +995,10 @@ This tracker is used in order to not lose any screen related update.</string>
</item>
</layout>
</item>
<item row="10" 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="0">
<layout class="QHBoxLayout" name="apperanceHeaderRowLayout">
<item row="7" column="0">
<layout class="QHBoxLayout" name="actionsHeaderRowLayout">
<item>
<spacer name="horizontalSpacer_4">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -1029,9 +1011,9 @@ This tracker is used in order to not lose any screen related update.</string>
</spacer>
</item>
<item>
<widget class="QLabel" name="appearanceLbl">
<widget class="QLabel" name="actionsLbl">
<property name="text">
<string>Appearance:</string>
<string>Actions:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
@ -1040,69 +1022,176 @@ This tracker is used in order to not lose any screen related update.</string>
</item>
</layout>
</item>
<item row="8" 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="0">
<layout class="QHBoxLayout" name="contextMenuRowLayout">
<item row="15" column="1">
<layout class="QHBoxLayout" name="screenDelayRowLayout">
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QSpinBox" name="screenTrackerSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeHint" stdset="0">
<property name="minimumSize">
<size>
<width>40</width>
<height>20</height>
<width>70</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="contextMenuLbl">
<property name="text">
<string>Context Menu:</string>
<property name="maximumSize">
<size>
<width>110</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Different hardware can have different delays during screen changes.
This tracker is used in order to not lose any screen related update.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="specialValueText">
<string/>
</property>
<property name="suffix">
<string> ms.</string>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>2500</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="13" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="contextMenuActionsBtn">
<widget class="QLabel" name="trackScreensDelayLbl">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<property name="toolTip">
<string>Different hardware can have different delays during screen changes.
This tracker is used in order to not lose any screen related update.</string>
</property>
<property name="text">
<string>reaction delay for changes</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>150</width>
<height>0</height>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
</spacer>
</item>
</layout>
</item>
<item row="10" column="0">
<layout class="QHBoxLayout" name="parabolicHeaderRowLayout">
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>16777215</width>
<height>16777215</height>
<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>Actions...</string>
<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">
<string>Start the application automatically after each relogin</string>
</property>
<property name="text">
<string>Enable autostart during startup</string>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="apperanceHeaderRowLayout">
<item>
<spacer name="horizontalSpacer_11">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@ -1114,14 +1203,33 @@ This tracker is used in order to not lose any screen related update.</string>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="appearanceLbl">
<property name="text">
<string>Appearance:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="broadcastGeomChkBox">
<property name="text">
<string>Inform Plasma desktop for available desktop space</string>
<item row="12" column="1">
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>

@ -33,13 +33,19 @@ TabPreferences::TabPreferences(Latte::Settings::Dialog::SettingsDialog *parent)
void TabPreferences::initUi()
{
//! exclusive group
//! 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->addButton(m_ui->smallParabolicBtn, Data::Preferences::PARABOLICSPREAD);
m_parabolicSpreadButtons->addButton(m_ui->mediumParabolicBtn, 5);
m_parabolicSpreadButtons->addButton(m_ui->largeParabolicBtn, 7);
m_parabolicSpreadButtons->setExclusive(true);
//! Buttons
connect(m_ui->contextMenuActionsBtn, &QPushButton::clicked, this, &TabPreferences::onActionsBtnPressed);
@ -52,6 +58,14 @@ void TabPreferences::initUi()
}
});
connect(m_parabolicSpreadButtons, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled),
[ = ](int id, bool checked) {
if (checked) {
m_preferences.parabolicSpread = id;
emit dataChanged();
}
});
connect(m_ui->screenTrackerSpinBox, QOverload<int>::of(&QSpinBox::valueChanged), [ = ](int i) {
m_preferences.screensDelay = m_ui->screenTrackerSpinBox->value();
emit dataChanged();
@ -111,6 +125,7 @@ void TabPreferences::initSettings()
o_preferences.metaHoldForBadges = m_corona->universalSettings()->metaPressAndHoldEnabled();
o_preferences.borderlessMaximized = m_corona->universalSettings()->canDisableBorders();
o_preferences.mouseSensitivity = m_corona->universalSettings()->sensitivity();
o_preferences.parabolicSpread = m_corona->universalSettings()->parabolicSpread();
o_preferences.screensDelay = m_corona->universalSettings()->screenTrackerInterval();
m_preferences = o_preferences;
@ -153,6 +168,14 @@ void TabPreferences::updateUi()
m_ui->highSensitivityBtn->setChecked(true);
}
if (m_preferences.parabolicSpread == Data::Preferences::PARABOLICSPREAD) {
m_ui->smallParabolicBtn->setChecked(true);
} else if (m_preferences.parabolicSpread == 5) {
m_ui->mediumParabolicBtn->setChecked(true);
} else if (m_preferences.parabolicSpread == 7) {
m_ui->largeParabolicBtn->setChecked(true);
}
emit dataChanged();
}
@ -195,6 +218,7 @@ void TabPreferences::save()
m_corona->universalSettings()->setMetaPressAndHoldEnabled(m_preferences.metaHoldForBadges);
m_corona->universalSettings()->setShowInfoWindow(m_preferences.layoutsInformationWindow);
m_corona->universalSettings()->setCanDisableBorders(m_preferences.borderlessMaximized);
m_corona->universalSettings()->setParabolicSpread(m_preferences.parabolicSpread);
m_corona->universalSettings()->setScreenTrackerInterval(m_preferences.screensDelay);
o_preferences = m_preferences;

@ -70,6 +70,7 @@ private:
Latte::Corona *m_corona{nullptr};
QButtonGroup *m_mouseSensitivityButtons;
QButtonGroup *m_parabolicSpreadButtons;
//! current data
Data::Preferences m_preferences;

@ -50,6 +50,7 @@ UniversalSettings::UniversalSettings(KSharedConfig::Ptr config, QObject *parent)
connect(this, &UniversalSettings::launchersChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::layoutsMemoryUsageChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::metaPressAndHoldEnabledChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::parabolicSpreadChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::sensitivityChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::screenTrackerIntervalChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::showInfoWindowChanged, this, &UniversalSettings::saveConfig);
@ -193,6 +194,21 @@ void UniversalSettings::setScreenTrackerInterval(int duration)
emit screenTrackerIntervalChanged();
}
int UniversalSettings::parabolicSpread() const
{
return m_parabolicSpread;
}
void UniversalSettings::setParabolicSpread(const int &spread)
{
if (m_parabolicSpread == spread) {
return;
}
m_parabolicSpread = spread;
emit parabolicSpreadChanged();
}
QString UniversalSettings::singleModeLayoutName() const
{
return m_singleModeLayoutName;
@ -527,6 +543,7 @@ void UniversalSettings::loadConfig()
m_screenTrackerInterval = m_universalGroup.readEntry("screenTrackerInterval", 2500);
m_showInfoWindow = m_universalGroup.readEntry("showInfoWindow", true);
m_singleModeLayoutName = m_universalGroup.readEntry("singleModeLayoutName", QString());
m_parabolicSpread = m_universalGroup.readEntry("parabolicSpread", Data::Preferences::PARABOLICSPREAD);
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));
@ -550,6 +567,7 @@ void UniversalSettings::saveConfig()
m_universalGroup.writeEntry("screenTrackerInterval", m_screenTrackerInterval);
m_universalGroup.writeEntry("showInfoWindow", m_showInfoWindow);
m_universalGroup.writeEntry("singleModeLayoutName", m_singleModeLayoutName);
m_universalGroup.writeEntry("parabolicSpread", m_parabolicSpread);
m_universalGroup.writeEntry("memoryUsage", (int)m_memoryUsage);
m_universalGroup.writeEntry("mouseSensitivity", (int)m_sensitivity);
syncSettings();

@ -12,6 +12,7 @@
#include <coretypes.h>
#include "../apptypes.h"
#include "../lattecorona.h"
#include "../data/preferencesdata.h"
// Qt
#include <QObject>
@ -47,6 +48,8 @@ class UniversalSettings : public QObject
Q_PROPERTY(bool colorsScriptIsPresent READ colorsScriptIsPresent NOTIFY colorsScriptIsPresentChanged)
Q_PROPERTY(bool showInfoWindow READ showInfoWindow WRITE setShowInfoWindow NOTIFY showInfoWindowChanged)
Q_PROPERTY(int parabolicSpread READ parabolicSpread WRITE setParabolicSpread NOTIFY parabolicSpreadChanged)
Q_PROPERTY(QString singleModeLayoutName READ singleModeLayoutName WRITE setSingleModeLayoutName NOTIFY singleModeLayoutNameChanged)
Q_PROPERTY(QStringList launchers READ launchers WRITE setLaunchers NOTIFY launchersChanged)
@ -91,6 +94,9 @@ public:
bool showInfoWindow() const;
void setShowInfoWindow(bool show);
int parabolicSpread() const;
void setParabolicSpread(const int &spread);
int version() const;
void setVersion(int ver);
@ -138,6 +144,7 @@ signals:
void layoutsMemoryUsageChanged();
void isAvailableGeometryBroadcastedToPlasmaChanged();
void metaPressAndHoldEnabledChanged();
void parabolicSpreadChanged();
void sensitivityChanged();
void screensCountChanged();
void screenScalesChanged();
@ -182,6 +189,7 @@ private:
int m_version{1};
int m_screenTrackerInterval{2500};
int m_parabolicSpread{Data::Preferences::PARABOLICSPREAD};
QString m_singleModeLayoutName;

@ -25,6 +25,7 @@ Ability.ParabolicEffectPrivate {
}
factor.maxZoom: Math.max(factor.zoom, animations.requirements.zoomFactor)
restoreZoomIsBlocked: restoreZoomIsBlockedFromApplet || (view && view.contextMenuIsShown)
spread: settings ? settings.parabolicSpread : 3
currentParabolicItem: view ? view.parabolic.currentItem : null
}

@ -19,6 +19,7 @@ AbilityHost.ParabolicEffect {
property Item debug: null
property Item layouts: null
property QtObject view: null
property QtObject settings: null
readonly property bool horizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal
@ -132,49 +133,6 @@ AbilityHost.ParabolicEffect {
lastParabolicItemIndex = index;
}
function applyParabolicEffect(index, currentMousePosition, center) {
var rDistance = Math.abs(currentMousePosition - center);
//check if the mouse goes right or down according to the center
var positiveDirection = ((currentMousePosition - center) >= 0 );
if (Qt.application.layoutDirection === Qt.RightToLeft && horizontal) {
positiveDirection = !positiveDirection;
}
//finding the zoom center e.g. for zoom:1.7, calculates 0.35
var zoomCenter = (factor.zoom - 1) / 2
//computes the in the scale e.g. 0...0.35 according to the mouse distance
//0.35 on the edge and 0 in the center
var firstComputation = (rDistance / center) * zoomCenter;
//calculates the scaling for the neighbour tasks
var bigNeighbourZoom = Math.min(1 + zoomCenter + firstComputation, factor.zoom);
var smallNeighbourZoom = Math.max(1 + zoomCenter - firstComputation, 1);
//bigNeighbourZoom = Number(bigNeighbourZoom.toFixed(4));
//smallNeighbourZoom = Number(smallNeighbourZoom.toFixed(4));
var leftScale;
var rightScale;
if(positiveDirection === true){
rightScale = bigNeighbourZoom;
leftScale = smallNeighbourZoom;
}
else {
rightScale = smallNeighbourZoom;
leftScale = bigNeighbourZoom;
}
sglUpdateHigherItemScale(index+1 , rightScale, 0);
sglUpdateLowerItemScale(index-1, leftScale, 0);
return {leftScale:leftScale, rightScale:rightScale};
}
//! TIMERS
//! Timer to check if the mouse is still outside the latteView in order to restore applets scales to 1.0

@ -18,7 +18,7 @@ Item {
readonly property bool isParabolicEnabled: parabolicAreaLoader.isParabolicEnabled
readonly property bool isThinTooltipEnabled: parabolicAreaLoader.isThinTooltipEnabled
property real center: (root.isHorizontal ? appletItem.width : appletItem.height) / 2
property real length: root.isHorizontal ? appletItem.width : appletItem.height
MouseArea {
id: parabolicMouseArea
@ -111,7 +111,7 @@ Item {
}
//use the new parabolic effect manager in order to handle all parabolic effect messages
var scales = parabolic.applyParabolicEffect(index, currentMousePosition, center);
var scales = parabolic.applyParabolicEffect(index, currentMousePosition, length);
//Left hiddenSpacer
if(appletItem.firstAppletInContainer){
@ -127,71 +127,81 @@ Item {
} //scale
function updateScale(nIndex, nScale, step){
if(appletItem && !appletItem.containsMouse && (appletItem.index === nIndex)){
function updateScale(nIndex, nScale){
if(appletItem && (appletItem.index === nIndex) /*&& !appletItem.containsMouse*/){ /*disable it in order to increase parabolic effect responsiveness*/
if ( (parabolicEffectIsSupported && !appletItem.originalAppletBehavior && !appletItem.communicator.indexerIsSupported)
&& (applet && applet.status !== PlasmaCore.Types.HiddenStatus)){
if(nScale >= 0) {
wrapper.zoomScale = nScale + step;
} else {
wrapper.zoomScale = wrapper.zoomScale + step;
}
wrapper.zoomScale = Math.max(1, nScale);
}
}
}
function sltUpdateLowerItemScale(delegateIndex, newScale, step) {
function sltUpdateItemScale(delegateIndex, newScales, islower) {
var ishigher = !islower;
var clearrequestedfromlastacceptedsignal = (newScales.length===1) && (newScales[0]===1);
var sideindex = islower ? appletItem.index-1 : appletItem.index+1;
if (delegateIndex === appletItem.index) {
if (communicator.parabolicEffectIsSupported) {
communicator.bridge.parabolic.client.hostRequestUpdateLowerItemScale(newScale, step);
if (islower) {
communicator.bridge.parabolic.client.hostRequestUpdateLowerItemScale(newScales);
} else {
communicator.bridge.parabolic.client.hostRequestUpdateHigherItemScale(newScales);
}
return;
}
if (!appletItem.isSeparator && !appletItem.isMarginsAreaSeparator && !appletItem.isHidden) {
//! when accepted
updateScale(delegateIndex, newScale, step);
if (newScales.length <= 0) {
return
}
var nextscales = newScales.slice(); //first copy scales in order to not touch referenced/same array to other slots
if (newScale > 1) { // clear lower items
parabolic.sglUpdateLowerItemScale(delegateIndex-1, 1, 0);
if (!appletItem.isSeparator && !appletItem.isMarginsAreaSeparator && !appletItem.isHidden) { //accept signal and apply the first scale in the stack
updateScale(delegateIndex, nextscales[0]); //apply scale
nextscales.splice(0, 1); //remove accepted and previously applied scale
if ((nextscales.length===1) && (nextscales[0]===1)) { //send clearrequestedfromlastacceptedsignal to inform neighbours in that direction to release zoom
if (islower) {
parabolic.sglUpdateLowerItemScale(sideindex, nextscales);
} else {
parabolic.sglUpdateHigherItemScale(sideindex, nextscales);
}
return;
}
}
if (!clearrequestedfromlastacceptedsignal) { //send remaining scales in the stack as long as this is not the clearrequestedfromlastacceptedsignal, in order to not send twice
if (islower) {
parabolic.sglUpdateLowerItemScale(appletItem.index-1, nextscales);
} else {
parabolic.sglUpdateHigherItemScale(appletItem.index+1, nextscales);
}
}
} else if (islower && clearrequestedfromlastacceptedsignal && (appletItem.index < delegateIndex)) { //accept requestedfromlastacceptedsignal in lower direction if that is the case
if (communicator.parabolicEffectIsSupported) {
communicator.bridge.parabolic.client.hostRequestUpdateLowerItemScale(newScales);
} else {
parabolic.sglUpdateLowerItemScale(delegateIndex-1, newScale, step);
updateScale(sideindex, 1);
}
} else if ((newScale === 1) && (appletItem.index < delegateIndex)) {
//! apply zoom clearing
} else if (ishigher && clearrequestedfromlastacceptedsignal && (appletItem.index > delegateIndex)) { //accept requestedfromlastacceptedsignal in higher direction if that is the case
if (communicator.parabolicEffectIsSupported) {
communicator.bridge.parabolic.client.hostRequestUpdateLowerItemScale(1, step);
communicator.bridge.parabolic.client.hostRequestUpdateHigherItemScale(newScales);
} else {
updateScale(appletItem.index, 1, 0);
updateScale(sideindex, 1);
}
}
}
function sltUpdateHigherItemScale(delegateIndex, newScale, step) {
if (delegateIndex === appletItem.index) {
if (communicator.parabolicEffectIsSupported) {
communicator.bridge.parabolic.client.hostRequestUpdateHigherItemScale(newScale, step);
return;
}
if (!appletItem.isSeparator && !appletItem.isMarginsAreaSeparator && !appletItem.isHidden) {
//! when accepted
updateScale(delegateIndex, newScale, step);
function sltUpdateLowerItemScale(delegateIndex, newScales) {
var islower = true;
sltUpdateItemScale(delegateIndex, newScales, islower);
}
if (newScale > 1) { // clear higher items
parabolic.sglUpdateHigherItemScale(delegateIndex+1, 1, 0);
}
} else {
parabolic.sglUpdateHigherItemScale(delegateIndex+1, newScale, step);
}
} else if ((newScale === 1) && (appletItem.index > delegateIndex)) {
//! apply zoom clearing
if (communicator.parabolicEffectIsSupported) {
communicator.bridge.parabolic.client.hostRequestUpdateHigherItemScale(1, step);
} else {
updateScale(appletItem.index, 1, 0);
}
}
function sltUpdateHigherItemScale(delegateIndex, newScales) {
var ishigher = false;
sltUpdateItemScale(delegateIndex, newScales, ishigher);
}
Component.onCompleted: {

@ -1015,6 +1015,7 @@ Item {
debug: _debug
layouts: layoutsContainer
view: latteView
settings: universalSettings
}
Ability.PositionShortcuts {

@ -8,12 +8,12 @@ import QtQuick 2.0
BridgeItem {
id: parabolicBridge
function clientRequestUpdateLowerItemScale(newScale, step) {
host.sglUpdateLowerItemScale(appletIndex-1, newScale, step);
function clientRequestUpdateLowerItemScale(newScales) {
host.sglUpdateLowerItemScale(appletIndex-1, newScales);
}
function clientRequestUpdateHigherItemScale(newScale, step) {
host.sglUpdateHigherItemScale(appletIndex+1, newScale, step);
function clientRequestUpdateHigherItemScale(newScales) {
host.sglUpdateHigherItemScale(appletIndex+1, newScales);
}
/*Be Careful, needs to be considered how to not create

@ -20,6 +20,7 @@ AbilityDefinition.ParabolicEffect {
factor: ref.parabolic.factor
restoreZoomIsBlocked: bridge ? (bridge.parabolic.host.restoreZoomIsBlocked || local.restoreZoomIsBlocked) : local.restoreZoomIsBlocked
currentParabolicItem: ref.parabolic.currentParabolicItem
spread: ref.parabolic.spread
readonly property bool isActive: bridge !== null
//! private properties can not go to definition because can not be made readonly in there
@ -37,6 +38,7 @@ AbilityDefinition.ParabolicEffect {
readonly property AbilityDefinition.ParabolicEffect local: AbilityDefinition.ParabolicEffect {
id: _localref
readonly property bool directRenderingEnabled: _localref._privates.directRenderingEnabled
spread: 3
}
Item {
@ -127,34 +129,34 @@ AbilityDefinition.ParabolicEffect {
}
}
function hostRequestUpdateLowerItemScale(newScale, step){
function hostRequestUpdateLowerItemScale(newScales){
//! function called from host
sglUpdateLowerItemScale(indexer.itemsCount-1, newScale, step);
sglUpdateLowerItemScale(indexer.itemsCount-1, newScales);
}
function hostRequestUpdateHigherItemScale(newScale, step){
function hostRequestUpdateHigherItemScale(newScales){
//! function called from host
sglUpdateHigherItemScale(0, newScale, step);
sglUpdateHigherItemScale(0, newScales);
}
function sltTrackLowerItemScale(delegateIndex, newScale, step){
function sltTrackLowerItemScale(delegateIndex, newScales){
//! send update signal to host
if (bridge) {
if (delegateIndex === -1) {
bridge.parabolic.clientRequestUpdateLowerItemScale(newScale, step);
} else if (newScale === 1 && delegateIndex>=0) {
bridge.parabolic.clientRequestUpdateLowerItemScale(1, 0);
bridge.parabolic.clientRequestUpdateLowerItemScale(newScales);
} else if ((newScales.length===1) && (newScales[0]===1) && delegateIndex>=0) {
bridge.parabolic.clientRequestUpdateLowerItemScale(newScales);
}
}
}
function sltTrackHigherItemScale(delegateIndex, newScale, step) {
function sltTrackHigherItemScale(delegateIndex, newScales) {
//! send update signal to host
if (bridge) {
if (delegateIndex >= indexer.itemsCount) {
bridge.parabolic.clientRequestUpdateHigherItemScale(newScale, step);
} else if (newScale === 1 && delegateIndex<indexer.itemsCount) {
bridge.parabolic.clientRequestUpdateHigherItemScale(1, 0);
bridge.parabolic.clientRequestUpdateHigherItemScale(newScales);
} else if ((newScales.length===1) && (newScales[0]===1) && delegateIndex<indexer.itemsCount) {
bridge.parabolic.clientRequestUpdateHigherItemScale(newScales);
}
}
}
@ -165,48 +167,6 @@ AbilityDefinition.ParabolicEffect {
}
}
function applyParabolicEffect(index, currentMousePosition, center) {
var rDistance = Math.abs(currentMousePosition - center);
//check if the mouse goes right or down according to the center
var positiveDirection = ((currentMousePosition - center) >= 0 );
if (Qt.application.layoutDirection === Qt.RightToLeft && horizontal) {
positiveDirection = !positiveDirection;
}
//finding the zoom center e.g. for zoom:1.7, calculates 0.35
var zoomCenter = (factor.zoom - 1) / 2
//computes the in the scale e.g. 0...0.35 according to the mouse distance
//0.35 on the edge and 0 in the center
var firstComputation = (rDistance / center) * zoomCenter;
//calculates the scaling for the neighbour tasks
var bigNeighbourZoom = Math.min(1 + zoomCenter + firstComputation, factor.zoom);
var smallNeighbourZoom = Math.max(1 + zoomCenter - firstComputation, 1);
//bigNeighbourZoom = Number(bigNeighbourZoom.toFixed(4));
//smallNeighbourZoom = Number(smallNeighbourZoom.toFixed(4));
var leftScale;
var rightScale;
if(positiveDirection === true){
rightScale = bigNeighbourZoom;
leftScale = smallNeighbourZoom;
}
else {
rightScale = smallNeighbourZoom;
leftScale = bigNeighbourZoom;
}
sglUpdateHigherItemScale(index+1 , rightScale, 0);
sglUpdateLowerItemScale(index-1, leftScale, 0);
return {leftScale:leftScale, rightScale:rightScale};
}
function invkClearZoom() {
if (parabolic.restoreZoomIsBlocked) {
return

@ -5,12 +5,17 @@
import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import "./paraboliceffect" as ParabolicEffectTypes
Item {
property bool isEnabled: false
property bool restoreZoomIsBlocked: false
property int spread: 3
property ParabolicEffectTypes.Factor factor: ParabolicEffectTypes.Factor{
zoom: 1.6
maxZoom: 1.6
@ -23,6 +28,48 @@ Item {
property Item currentParabolicItem: null
signal sglClearZoom();
signal sglUpdateLowerItemScale(int delegateIndex, real newScale, real step);
signal sglUpdateHigherItemScale(int delegateIndex, real newScale, real step);
signal sglUpdateLowerItemScale(int delegateIndex, variant newScales);
signal sglUpdateHigherItemScale(int delegateIndex, variant newScales);
readonly property int _spreadSteps: (spread - 1) / 2
function applyParabolicEffect(itemIndex, itemMousePosition, itemLength) {
var percentage = Math.max(0, Math.min(1, itemMousePosition / itemLength));
//! left scales
var leftScales = [];
for (var i=_spreadSteps; i>=1; --i) {
leftScales.push(linearEffect(1-percentage, i, _spreadSteps));
}
leftScales.push(1); //! clearing
//! right scales
var rightScales = [];
for (var j=_spreadSteps; j>=1; --j) {
rightScales.push(linearEffect(percentage, j, _spreadSteps));
}
rightScales.push(1); //! clearing
var reversed = Qt.application.layoutDirection === Qt.RightToLeft && (plasmoid.formFactor === PlasmaCore.Types.Horizontal);
if (reversed) {
var temp = leftScales;
leftScales = rightScales;
rightScales = temp;
}
sglUpdateHigherItemScale(itemIndex+1, rightScales);
sglUpdateLowerItemScale(itemIndex-1, leftScales);
return {leftScale:leftScales[0], rightScale:rightScales[0]};
}
function linearEffect(mousePosPercentage, partIndex, partsCount) {
var part = 1/partsCount;
var min = (partIndex-1) * part;
var max = partIndex * part;
var x = min + (max-min) * mousePosPercentage;
var yl = (factor.zoom - 1) * x;
return 1+yl;
}
}

@ -19,6 +19,7 @@ AbilityDefinition.ParabolicEffect {
readonly property alias directRenderingEnabled: apis.directRenderingEnabled
readonly property alias factor: apis.factor
readonly property alias restoreZoomIsBlocked: apis.restoreZoomIsBlocked
readonly property alias spread: apis.spread
readonly property alias currentParabolicItem: apis.currentParabolicItem
signal sglClearZoom();

@ -20,7 +20,7 @@ Item {
readonly property bool isParabolicEnabled: parabolicEventsAreaLoader.isParabolicEnabled
readonly property bool isThinTooltipEnabled: parabolicEventsAreaLoader.isThinTooltipEnabled
readonly property real center: abilityItem.parabolicItem.center
readonly property real length: abilityItem.isHorizontal ? abilityItem.width : abilityItem.height
MouseArea {
id: parabolicMouseArea
@ -131,7 +131,7 @@ Item {
}
//use the new parabolic ability in order to handle all parabolic effect messages
var scales = abilityItem.abilities.parabolic.applyParabolicEffect(index, currentMousePosition, center);
var scales = abilityItem.abilities.parabolic.applyParabolicEffect(index, currentMousePosition, length);
//Left hiddenSpacer for first task
if((index === abilityItem.abilities.indexer.firstVisibleItemIndex) && abilityItem.abilities.containment.isFirstAppletInContainment) {
@ -153,61 +153,68 @@ Item {
}
} //zoom
function updateScale(nIndex, nScale, step){
if (!_parabolicArea.containsMouse && (index === nIndex) && !parabolicItem.isParabolicEventBlocked){
function updateScale(nIndex, nScale){
if (index === nIndex /*&& !_parabolicArea.containsMouse*/ /*&& !parabolicItem.isParabolicEventBlocked*/){ //!disabled them in order to provide smoother parabolic effect during dock showing and first hovering
if (parabolicItem.isUpdatingOnlySpacers) {
var subSpacerScale = (nScale-1)/2;
hiddenSpacerLeft.nScale = subSpacerScale;
hiddenSpacerRight.nScale = subSpacerScale;
} else {
var newScale = 1;
if(nScale >= 0) {
newScale = nScale + step;
} else {
newScale = abilityItem.parabolicItem.zoom + step;
}
abilityItem.parabolicItem.zoom = newScale;
abilityItem.parabolicItem.zoom = Math.max(1, nScale);
}
}
}
function sltUpdateLowerItemScale(delegateIndex, newScale, step) {
function sltUpdateItemScale(delegateIndex, newScales, islower) {
var ishigher = !islower;
var clearrequestedfromlastacceptedsignal = (newScales.length===1) && (newScales[0]===1);
var sideindex = islower ? index-1 : index+1;
if (delegateIndex === index) {
if (!abilityItem.isSeparator && !abilityItem.isHidden) {
//! when accepted
updateScale(delegateIndex, newScale, step);
if (newScales.length <= 0) {
return
}
var nextscales = newScales.slice(); //first copy scales in order to not touch referenced/same array to other slots
if (!abilityItem.isSeparator && !abilityItem.isHidden) { //accept signal and apply the first scale in the stack
updateScale(delegateIndex, nextscales[0]); //apply scale
nextscales.splice(0,1); //remove accepted and previously applied scale
if (newScale > 1) { // clear lower items
abilityItem.abilities.parabolic.sglUpdateLowerItemScale(delegateIndex-1, 1, 0);
if ((nextscales.length===1) && (nextscales[0]===1)) { //send clearrequestedfromlastacceptedsignal to inform neighbours in that direction to release zoom
if (islower) {
abilityItem.abilities.parabolic.sglUpdateLowerItemScale(sideindex, nextscales);
} else {
abilityItem.abilities.parabolic.sglUpdateHigherItemScale(sideindex, nextscales);
}
return;
}
} else {
abilityItem.abilities.parabolic.sglUpdateLowerItemScale(delegateIndex-1, newScale, step);
}
} else if ((newScale === 1) && (index < delegateIndex)) {
updateScale(index, 1, 0);
}
}
function sltUpdateHigherItemScale(delegateIndex, newScale, step) {
if (delegateIndex === index) {
if (!abilityItem.isSeparator && !abilityItem.isHidden) {
//! when accepted
updateScale(delegateIndex, newScale, step);
if (newScale > 1) { // clear lower items
abilityItem.abilities.parabolic.sglUpdateHigherItemScale(delegateIndex+1, 1, 0); // clear higher items
if (!clearrequestedfromlastacceptedsignal) { //send remaining scales in the stack as long as this is not the clearrequestedfromlastacceptedsignal, in order to not send twice
if (islower) {
abilityItem.abilities.parabolic.sglUpdateLowerItemScale(sideindex, nextscales);
} else {
abilityItem.abilities.parabolic.sglUpdateHigherItemScale(sideindex, nextscales);
}
} else {
abilityItem.abilities.parabolic.sglUpdateHigherItemScale(delegateIndex+1, newScale, step);
}
} else if ((newScale === 1) && (index > delegateIndex)) {
updateScale(index, 1, 0);
} else if ((islower && clearrequestedfromlastacceptedsignal && (index < delegateIndex)) //accept requestedfromlastacceptedsignal in lower direction if that is the case
|| (ishigher && clearrequestedfromlastacceptedsignal && (index > delegateIndex))) { //accept requestedfromlastacceptedsignal in higher direction if that is the case
updateScale(index, 1);
}
}
function sltUpdateLowerItemScale(delegateIndex, newScales) {
var islower = true;
sltUpdateItemScale(delegateIndex, newScales, islower);
}
function sltUpdateHigherItemScale(delegateIndex, newScales) {
var ishigher = false;
sltUpdateItemScale(delegateIndex, newScales, ishigher);
}
Component.onCompleted: {
abilityItem.abilities.parabolic.sglUpdateLowerItemScale.connect(sltUpdateLowerItemScale);
abilityItem.abilities.parabolic.sglUpdateHigherItemScale.connect(sltUpdateHigherItemScale);

@ -49,9 +49,7 @@ Item{
property real visualScaledLength: (abilityItem.abilities.metrics.iconSize + abilityItem.abilities.metrics.totals.lengthPaddings) * zoom
property real visualScaledThickness: abilityItem.abilities.metrics.totals.thickness * zoom
/// end of Scalers///////
property real center: (abilityItem.isHorizontal ? abilityItem.width : abilityItem.height) / 2
/// end of Scalers///////
readonly property alias contentItemContainer: _contentItemContainer
readonly property alias titleTooltipVisualParent: _titleTooltipVisualParent

Loading…
Cancel
Save