volctl: apply bugfix patches

This actually serves to bring volctl up to the current git master
but upstream has not tagged a release in several months.
This commit is contained in:
Toyam Cox 2016-12-07 19:35:55 -05:00
parent a023bdc22f
commit 63e99bdeb5
2 changed files with 96 additions and 1 deletions

View file

@ -0,0 +1,95 @@
These are all already applied upstream as 3 commits. Upstream has not tagged
a release as of 03-Dec-2016 but these fix usability bugs.
From 40cf595d40ce0c58733abb683b0743af8d0a7498 Mon Sep 17 00:00:00 2001
From: Narrat <autumn-wind@web.de>
Date: Sun, 1 May 2016 11:14:39 +0200
Subject: [PATCH] PyGI deprecations
VScale and VSeparator are deprecated since 3.2
diff --git a/volctl/tray.py b/volctl/tray.py
index 45601b8..ea41ce7 100644
--- volctl/tray.py
+++ volctl/tray.py
@@ -229,7 +229,7 @@ def create_sliders(self):
# separator
if len(self.volctl.pa_mgr.pa_sink_inputs) > 0:
- separator = Gtk.VSeparator()
+ separator = Gtk.Separator().new(Gtk.Orientation.VERTICAL)
separator.set_margin_top(6)
separator.set_margin_bottom(6)
self.grid.attach(separator, x, 0, 1, 2)
@@ -251,7 +251,7 @@ def create_sliders(self):
def add_scale(self, sink):
# scale
- scale = Gtk.VScale()
+ scale = Gtk.Scale().new(Gtk.Orientation.VERTICAL)
scale.set_draw_value(False)
scale.set_value_pos(Gtk.PositionType.BOTTOM)
scale.set_range(PA_VOLUME_MUTED, PA_VOLUME_NORM)
From d5fdee19de1cf64856c9d8ddf8a46682c6971f2b Mon Sep 17 00:00:00 2001
From: Mirko Dietrich <mirko.dietrich@l4m1.de>
Date: Tue, 3 May 2016 02:10:57 +0200
Subject: [PATCH] Fixed slider window position (closes #7)
diff --git a/volctl/tray.py b/volctl/tray.py
index ea41ce7..2a8d12e 100644
--- volctl/tray.py
+++ volctl/tray.py
@@ -190,6 +190,7 @@ def __init__(self, volctl):
self.create_sliders()
self.win.show_all()
+ self.set_position()
def _find_idx_by_scale(self, scale, scales):
for idx, v in scales.iteritems():
@@ -206,10 +207,13 @@ def _find_sink_input_idx_by_scale(self, scale):
def set_position(self):
a, screen, rect, orient = self.volctl.statusicon.get_geometry()
- self.win.move(rect.x, rect.y + rect.height)
+ # hack-ish but works
+ if rect.y > screen.height() / 2:
+ self.win.move(rect.x, rect.y - self.win.get_size()[1])
+ else:
+ self.win.move(rect.x, rect.y + rect.height)
def create_sliders(self):
- self.set_position()
x = 0
# touching pa objects here!
From 4c6a59e572889964c0385d7b1d52e8d772995154 Mon Sep 17 00:00:00 2001
From: Mirko Dietrich <mirko.dietrich@l4m1.de>
Date: Tue, 10 May 2016 21:09:24 +0200
Subject: [PATCH] sliders should not grow out of screen (closed #10)
diff --git a/volctl/tray.py b/volctl/tray.py
index 2a8d12e..e47984b 100644
--- volctl/tray.py
+++ volctl/tray.py
@@ -207,11 +207,16 @@ def _find_sink_input_idx_by_scale(self, scale):
def set_position(self):
a, screen, rect, orient = self.volctl.statusicon.get_geometry()
- # hack-ish but works
+ win_width, win_height = self.win.get_size()
+ # slider window should not leave screen boundaries
+ x = rect.x
+ if x + win_width > screen.width():
+ x = screen.width() - win_width
+ # top or bottom panel?
if rect.y > screen.height() / 2:
- self.win.move(rect.x, rect.y - self.win.get_size()[1])
+ self.win.move(x, rect.y - win_height)
else:
- self.win.move(rect.x, rect.y + rect.height)
+ self.win.move(x, rect.y + rect.height)
def create_sliders(self):
x = 0

View file

@ -1,7 +1,7 @@
# Template file for 'volctl'
pkgname=volctl
version=0.4
revision=2
revision=3
noarch=yes
build_style=python2-module
pycompile_module="volctl"