[clocks] Fixed some alignments and padding
- From: Seif Lotfy <seiflotfy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clocks] Fixed some alignments and padding
- Date: Thu, 7 Jun 2012 22:21:05 +0000 (UTC)
commit e8ba2ec01e38a2aca3878be126127648ab795693
Author: Seif Lotfy <seif lotfy collabora co uk>
Date: Fri Jun 8 00:20:32 2012 +0200
Fixed some alignments and padding
clocks.py | 16 ++++----------
timer.py | 66 +++++++++++++++++++++++++-----------------------------------
2 files changed, 33 insertions(+), 49 deletions(-)
---
diff --git a/clocks.py b/clocks.py
index 81b3001..d394d13 100644
--- a/clocks.py
+++ b/clocks.py
@@ -177,14 +177,11 @@ class Stopwatch (Clock):
box.pack_start (Gtk.Box(), True, True, 0)
box.pack_start (vbox, False, False, 0)
box.pack_end (Gtk.Box(), True, True, 0)
-
- vbox.pack_start(Gtk.Label(""), True, True, 0)
-
+
self.stopwatchLabel = Gtk.Label ()
self.stopwatchLabel.set_alignment (0.5, 0.5)
self.stopwatchLabel.set_markup (STOPWATCH_LABEL_MARKUP%(0,0))
- vbox.pack_start (self.stopwatchLabel, False, False, 0)
-
+
hbox = Gtk.Box()
self.leftButton = Gtk.Button ()
self.leftButton.set_size_request(200, -1)
@@ -202,12 +199,9 @@ class Stopwatch (Clock):
hbox.pack_start (Gtk.Box(), True, True, 24)
hbox.pack_start (self.rightButton, True, True, 0)
- box = Gtk.Box ()
- box.pack_start (Gtk.Box (), True, True, 0)
- box.pack_start (hbox, True, True, 0)
- box.pack_start (Gtk.Box (), True, True, 0)
-
- vbox.pack_start (box, False, False, 32)
+ vbox.pack_start (Gtk.Label(""), True, True, 0)
+ vbox.pack_start (self.stopwatchLabel, False, False, 0)
+ vbox.pack_start (hbox, False, False, 32)
vbox.pack_start (Gtk.Box(), True, True, 0)
vbox.pack_start (Gtk.Box(), True, True, 0)
diff --git a/timer.py b/timer.py
index d37b24c..24119de 100644
--- a/timer.py
+++ b/timer.py
@@ -1,6 +1,7 @@
"""
- Copyright (c) 2011-2012 Collabora, Ltd.
-
+ Copyright (c) 2012 Eslam Mostafa <cseslam gmail com>
+ Copyright (c) 2012 Collabora, Ltd.
+ Authored by: Seif Lotfy <seif lotfy collabora co uk>
Gnome Clocks is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
@@ -14,8 +15,6 @@
You should have received a copy of the GNU General Public License along
with Gnome Documents; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
- Author: Eslam Mostafa <cseslam gmail com>
"""
@@ -43,14 +42,15 @@ class Spinner(Gtk.Box):
#Value
self.value = Gtk.Label('')
self.value.set_markup(TIMER%(0))
+ self.value.set_alignment (0.5, 0.5)
#Down Button
self.down = Gtk.Button()
self.down.set_image(imageDown)
self.down.set_relief(Gtk.ReliefStyle.NONE)
#
- self.pack_start(self.up, False, False, 5)
- self.pack_start(self.value, False, False, 5)
- self.pack_start(self.down, False, False, 5)
+ self.pack_start(self.up, False, False, 0)
+ self.pack_start(self.value, True, True, 0)
+ self.pack_start(self.down, False, False, 0)
#Signals
self.up.connect('clicked', self._increase)
self.down.connect('clicked', self._decrease)
@@ -99,12 +99,10 @@ class TimerScreen (Gtk.Box):
self.set_orientation(Gtk.Orientation.VERTICAL)
self.timer = timer
top_spacer = Gtk.Label("")
-
- contents = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
+
self.timerLabel = Gtk.Label ()
self.timerLabel.set_alignment (0.5, 0.5)
self.timerLabel.set_markup (TIMER_LABEL_MARKUP%(0,0))
- contents.pack_start (self.timerLabel, False, False, 0)
hbox = Gtk.Box()
self.leftButton = Gtk.Button ()
@@ -123,30 +121,23 @@ class TimerScreen (Gtk.Box):
hbox.pack_start (Gtk.Box(), True, True, 24)
hbox.pack_start (self.rightButton, True, True, 0)
- box = Gtk.Box ()
- box.pack_start (Gtk.Box (), True, True, 0)
- box.pack_start (hbox, True, True, 0)
- box.pack_start (Gtk.Box (), True, True, 0)
-
- contents.pack_start (box, False, False, 32)
- contents.pack_start (Gtk.Box(), True, True, 0)
- contents.pack_start (Gtk.Box(), True, True, 0)
self.leftLabel.set_markup (TIMER_BUTTON_MARKUP%("Cancel"))
self.leftLabel.set_padding (6, 0)
self.rightLabel.set_markup (TIMER_BUTTON_MARKUP%("Pause"))
self.rightLabel.set_padding (6, 0)
-
- bottom_spacer = Gtk.Label("")
-
+
self.leftButton.connect('clicked', self._on_left_button_clicked)
self.rightButton.connect('clicked', self._on_right_button_clicked)
-
- self.pack_start(top_spacer, True, True, 0)
- self.pack_start(contents, False, False, 0)
- self.pack_start(bottom_spacer, True, True, 0)
-
-
+
+ self.pack_start(Gtk.Label(""), False, False, 0)
+ self.pack_start(Gtk.Label(""), True, True, 0)
+ self.pack_start(self.timerLabel, False, False, 0)
+ self.pack_start(hbox, False, False, 32)
+ self.pack_start(Gtk.Label(""), True, True, 0)
+ self.pack_start(Gtk.Label(""), True, True, 0)
+
+
def _on_left_button_clicked(self, data):
self.timer.cancel()
@@ -171,7 +162,6 @@ class TimerWelcomeScreen (Gtk.Box):
self.timer = timer
self.set_orientation(Gtk.Orientation.VERTICAL)
- top_spacer = Gtk.Label('')
spinner = Gtk.Box () #Containes 3 columns to set the time
self.hours = Spinner('hours', self)
@@ -179,9 +169,9 @@ class TimerWelcomeScreen (Gtk.Box):
colon = Gtk.Label('')
colon.set_markup('<span font_desc=\"64.0\">:</span>')
- spinner.pack_start(self.hours, False, True, 20)
- spinner.pack_start(colon, False, True, 20)
- spinner.pack_start(self.minutes, False, True, 20)
+ spinner.pack_start(self.hours, False, False, 0)
+ spinner.pack_start(colon, False, False, 0)
+ spinner.pack_start(self.minutes, False, False, 0)
#Start Button
self.startButton = Gtk.Button()
@@ -193,13 +183,13 @@ class TimerWelcomeScreen (Gtk.Box):
self.startLabel.set_padding (6, 0)
self.startButton.add(self.startLabel)
self.startButton.connect('clicked', self._on_start_clicked)
- #
- bottom_spacer = Gtk.Label("")
- #
- self.pack_start(top_spacer, True, True, 0)
- self.pack_start(spinner, False, True, 5)
- self.pack_start(self.startButton, False, True, 5)
- self.pack_start(bottom_spacer, True, True, 0)
+
+ self.pack_start(Gtk.Label(""), False, False, 0)
+ self.pack_start(Gtk.Label(""), True, True, 0)
+ self.pack_start(spinner, False, False, 0)
+ self.pack_start(self.startButton, False, False, 6)
+ self.pack_start(Gtk.Label(""), True, True, 0)
+ self.pack_start(Gtk.Label(""), True, True, 42)
def update_start_button_status(self):
hours = self.hours.get_value()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]