Merge pull request #7719 from Sir-Boops/volctl

volctl: update to 0.5.1
This commit is contained in:
Enno Boland 2017-09-19 11:44:16 +02:00 committed by GitHub
commit 9b7299f072
2 changed files with 3 additions and 98 deletions

View File

@ -1,95 +0,0 @@
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=3
version=0.5.1
revision=1
noarch=yes
build_style=python2-module
pycompile_module="volctl"
@ -12,4 +12,4 @@ maintainer="xo <oh@rotce.de>"
license="GPL-2"
homepage="https://buzz.github.io/volctl/"
distfiles="https://github.com/buzz/volctl/archive/${version}.tar.gz"
checksum=31b7079767172c03653af380181272ade50f04f7ca32c69725239ea8116f0640
checksum=4172f362ef1d428817f2013211a616e9049afede4ae424044f3ae70e04689de7