summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorQue Quotion2018-06-19 04:29:17 +0900
committerQue Quotion2018-06-19 04:29:17 +0900
commit3afc79442c58621b61554a63929bed680b8a9571 (patch)
tree88d97502d239c068ba4a7affbc49293c1a8735ae
parent8f5ef3564125f17b844f1b2e00a3efff44c65730 (diff)
downloadaur-3afc79442c58621b61554a63929bed680b8a9571.tar.gz
Add autohide delay; draw struts after animation
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--autohide.patch48
3 files changed, 36 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6185a4db293..be384915ed4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = wingpanel-standalone-git
pkgdesc = Stylish top panel that holds indicators and spawns an application launcher (without Gala dependencies)
pkgver = r358.5a038ca
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/elementary/wingpanel
arch = i686
arch = x86_64
@@ -51,7 +51,7 @@ pkgbase = wingpanel-standalone-git
sha256sums = 7f972d79b4d72f7b274a96e1a5150cba0e3869ad85215ae01ad2bc19802cdbb9
sha256sums = 21e95aec3fbb920f3b8ef34b00bf4fc99f431e1837f84f020d5d00c4e3aaca0b
sha256sums = b1902c1d44ac546df63cd0224a7d2ef2cb6394ca556512c30c370d387db7bbab
- sha256sums = 6f9a37b8d0641761c9a4f7dcadb46d063e04504d7af95af5744a60c2c424aa7f
+ sha256sums = cd7a7bf3c3cec2812f0bb4a355588fe95530c6220e0c92abcae49713ab66f924
pkgname = wingpanel-standalone-git
diff --git a/PKGBUILD b/PKGBUILD
index c14f4485f01..704c9b36893 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=wingpanel-standalone-git
pkgver=r358.5a038ca
-pkgrel=1
+pkgrel=2
pkgdesc='Stylish top panel that holds indicators and spawns an application launcher (without Gala dependencies)'
arch=('i686' 'x86_64')
url='https://github.com/elementary/wingpanel'
@@ -33,7 +33,7 @@ sha256sums=('SKIP'
'7f972d79b4d72f7b274a96e1a5150cba0e3869ad85215ae01ad2bc19802cdbb9'
'21e95aec3fbb920f3b8ef34b00bf4fc99f431e1837f84f020d5d00c4e3aaca0b'
'b1902c1d44ac546df63cd0224a7d2ef2cb6394ca556512c30c370d387db7bbab'
- '6f9a37b8d0641761c9a4f7dcadb46d063e04504d7af95af5744a60c2c424aa7f')
+ 'cd7a7bf3c3cec2812f0bb4a355588fe95530c6220e0c92abcae49713ab66f924')
pkgver() {
cd wingpanel
diff --git a/autohide.patch b/autohide.patch
index 848adf68d58..74d10a26f37 100644
--- a/autohide.patch
+++ b/autohide.patch
@@ -2,7 +2,7 @@ diff --git a/wingpanel/schemas/io.elementary.desktop.wingpanel.gschema.xml b/win
index c81abd5..890e277 100644
--- a/wingpanel/schemas/io.elementary.desktop.wingpanel.gschema.xml
+++ b/wingpanel-qq/schemas/io.elementary.desktop.wingpanel.gschema.xml
-@@ -6,5 +6,15 @@
+@@ -6,5 +6,21 @@
<summary>Sets if the panel uses transparency.</summary>
<description>Disable this to provide higher contrasts and make indicators better readable.</description>
</key>
@@ -16,6 +16,12 @@ index c81abd5..890e277 100644
+ <summary>Sets if and how the panel will autohide.</summary>
+ <description>Enable this to increase available desktop area and reduce clutter.</description>
+ </key>
++ <key type="i" name="delay">
++ <range min="0" max="1000"/>
++ <default>200</default>
++ <summary>Sets how long before the panel will autohide in milliseconds.</summary>
++ <description>Increase or decrease this value to your preference.</description>
++ </key>
</schema>
</schemalist>
diff --git a/wingpanel/src/PanelWindow.vala b/wingpanel-qq/src/PanelWindow.vala
@@ -32,13 +38,14 @@ index c48b5ea..81ec2f2 100644
private int monitor_number;
private int monitor_width;
private int monitor_height;
-@@ -30,6 +33,9 @@ public class Wingpanel.PanelWindow : Gtk.Window {
+@@ -30,6 +33,10 @@ public class Wingpanel.PanelWindow : Gtk.Window {
private bool expanded = false;
private int panel_displacement;
private uint shrink_timeout = 0;
+ private bool hiding = false;
+ private bool restrut = true;
+ private string autohide = Services.PanelSettings.get_default ().autohide;
++ private int autohide_delay = Services.PanelSettings.get_default ().delay;
public PanelWindow (Gtk.Application application) {
Object (
@@ -52,7 +59,7 @@ index c48b5ea..81ec2f2 100644
update_visual ();
-@@ -71,17 +79,33 @@ public class Wingpanel.PanelWindow : Gtk.Window {
+@@ -71,17 +79,40 @@ public class Wingpanel.PanelWindow : Gtk.Window {
application.add_accelerator ("<Control>Tab", "app.cycle", null);
application.add_accelerator ("<Control><Shift>Tab", "app.cycle-back", null);
@@ -61,6 +68,10 @@ index c48b5ea..81ec2f2 100644
+ update_autohide_mode ();
+ });
+
++ Services.PanelSettings.get_default ().notify["delay"].connect (() => {
++ autohide_delay = Services.PanelSettings.get_default ().delay;
++ });
++
add (panel);
}
@@ -70,12 +81,18 @@ index c48b5ea..81ec2f2 100644
+ if (hiding != true) {
+ if (panel_displacement <= panel_height * (-1)) {
+ timeout = 0;
++ if (restrut == true) {
++ update_panel_dimensions ();
++ }
+ return false;
+ }
+ panel_displacement--;
+ } else {
+ if (panel_displacement >= -1 || popover_manager.current_indicator != null) {
+ timeout = 0;
++ if (restrut == true) {
++ update_panel_dimensions ();
++ }
+ return false;
+ }
+ panel_displacement++;
@@ -84,9 +101,6 @@ index c48b5ea..81ec2f2 100644
- panel_displacement--;
-
- update_panel_dimensions ();
-+ if (restrut == true) {
-+ update_panel_dimensions ();
-+ }
+ animate_panel ();
return true;
@@ -112,10 +126,10 @@ index c48b5ea..81ec2f2 100644
+ if (timeout > 0) {
+ Source.remove (timeout);
+ }
-+ if (autohide == "Dodge") {
-+ restrut = true;
-+ timeout = Timeout.add (300 / panel_height, animation_step);
-+ } else if (autohide == "Autohide") {
++ if (popover_manager.current_indicator == null) {
++ Thread.usleep (autohide_delay * 1000);
++ }
++ if (autohide == "Autohide" || autohide == "Dodge") {
+ restrut = true;
+ timeout = Timeout.add (100 / panel_height, animation_step);
+ } else if (autohide == "Float") {
@@ -132,10 +146,10 @@ index c48b5ea..81ec2f2 100644
+ if (timeout > 0) {
+ Source.remove (timeout);
+ }
-+ if (autohide == "Dodge") {
-+ restrut = true;
-+ timeout = Timeout.add (300 / panel_height, animation_step);
-+ } else if (autohide == "Autohide") {
++ if (popover_manager.current_indicator == null) {
++ Thread.usleep (autohide_delay * 1000);
++ }
++ if (autohide == "Autohide" || autohide == "Dodge") {
+ restrut = true;
+ timeout = Timeout.add (100 / panel_height, animation_step);
+ } else if (autohide == "Float") {
@@ -150,7 +164,7 @@ index c48b5ea..81ec2f2 100644
+ restrut = true;
+ if (autohide == "Disabled" || autohide == "Dodge") {
+ hiding = false;
-+ timeout = Timeout.add (300 / panel_height, animation_step);
++ timeout = Timeout.add (100 / panel_height, animation_step);
+ } else {
+ hiding = true;
+ timeout = Timeout.add (100 / panel_height, animation_step);
@@ -187,12 +201,14 @@ diff --git a/wingpanel/src/Services/Settings.vala b/wingpanel-qq/src/Services/Se
index 3bcd0a7..eeecbb8 100644
--- a/wingpanel/src/Services/Settings.vala
+++ b/wingpanel-qq/src/Services/Settings.vala
-@@ -23,6 +23,8 @@ namespace Wingpanel.Services {
+@@ -23,6 +23,10 @@ namespace Wingpanel.Services {
public bool use_transparency { get; set; }
+ public string autohide { get; set; }
+
++ public int delay { get; set; }
++
public PanelSettings () {
base ("io.elementary.desktop.wingpanel");
}