[hamster-applet] behavioural positioning - avoid applet from changing size when switching between no activity/started
- From: Toms Baugis <tbaugis src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [hamster-applet] behavioural positioning - avoid applet from changing size when switching between no activity/started
- Date: Fri, 5 Feb 2010 11:31:56 +0000 (UTC)
commit e0ccb5bf99ff91b8521138546c7019db57f20c22
Author: Toms Bauģis <toms baugis gmail com>
Date: Fri Feb 5 11:30:17 2010 +0000
behavioural positioning - avoid applet from changing size when switching between no activity/started tracking
data/applet.ui | 101 ++++++++++++++-----------
data/hamster.ui | 197 +++++++++++++++++++++++------------------------
src/hamster-standalone | 18 ++---
src/hamster/applet.py | 18 ++---
4 files changed, 168 insertions(+), 166 deletions(-)
---
diff --git a/data/applet.ui b/data/applet.ui
index afdcc37..5bbe5d0 100644
--- a/data/applet.ui
+++ b/data/applet.ui
@@ -40,6 +40,7 @@
<property name="visible">True</property>
<child>
<object class="GtkVBox" id="vbox6">
+ <property name="width_request">520</property>
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
@@ -77,18 +78,39 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox4">
+ <object class="GtkAlignment" id="tag_box">
<property name="visible">True</property>
+ <property name="left_padding">4</property>
+ <property name="right_padding">4</property>
<child>
- <object class="GtkLinkButton" id="more_info_button">
- <property name="label" translatable="yes">Tell me more</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
- <property name="relief">none</property>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="height_request">40</property>
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkVBox" id="activity_info_box">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="last_activity_duration">
+ <property name="visible">True</property>
<property name="xalign">0</property>
- <property name="uri"> </property>
- <signal name="clicked" handler="on_more_info_button_clicked"/>
+ <property name="label">1h 23m</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
</object>
<packing>
<property name="expand">False</property>
@@ -96,13 +118,15 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="tag_box">
+ <object class="GtkLabel" id="last_activity_description">
<property name="visible">True</property>
- <property name="left_padding">4</property>
- <property name="right_padding">4</property>
- <child>
- <placeholder/>
- </child>
+ <property name="no_show_all">True</property>
+ <property name="xalign">0</property>
+ <property name="label">it's like in case if you need a description, i'll be here</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="size" value="10000"/>
+ </attributes>
</object>
<packing>
<property name="position">1</property>
@@ -110,43 +134,30 @@
</child>
</object>
<packing>
- <property name="position">2</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLinkButton" id="more_info_button">
+ <property name="label" translatable="yes">Tell me more</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="uri"> </property>
+ <signal name="clicked" handler="on_more_info_button_clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="last_activity_duration">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label">1h 23m</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="last_activity_description">
- <property name="visible">True</property>
- <property name="no_show_all">True</property>
- <property name="xalign">0</property>
- <property name="label">it's like in case if you need a description, i'll be here</property>
- <property name="wrap">True</property>
- <attributes>
- <attribute name="size" value="10000"/>
- </attributes>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="position">0</property>
diff --git a/data/hamster.ui b/data/hamster.ui
index f73eb0f..b46964b 100644
--- a/data/hamster.ui
+++ b/data/hamster.ui
@@ -141,101 +141,40 @@
<property name="orientation">vertical</property>
<property name="spacing">20</property>
<child>
- <object class="GtkVBox" id="vbox3">
+ <object class="GtkHBox" id="current_activity_box">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
<child>
- <object class="GtkHBox" id="current_activity_box">
+ <object class="GtkVBox" id="vbox6">
+ <property name="width_request">520</property>
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkVBox" id="vbox6">
+ <object class="GtkHBox" id="hbox1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="spacing">4</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkLabel" id="last_activity_name">
<property name="visible">True</property>
- <property name="spacing">4</property>
- <child>
- <object class="GtkLabel" id="last_activity_name">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label">Just an activity</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- <attribute name="size" value="15000"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="last_activity_category">
- <property name="visible">True</property>
- <property name="no_show_all">True</property>
- <property name="xalign">0</property>
- <property name="label"> - Work</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- <attribute name="size" value="15000"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkHBox" id="hbox4">
- <property name="visible">True</property>
- <child>
- <object class="GtkLinkButton" id="more_info_button">
- <property name="label" translatable="yes">Tell me more</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
- <property name="relief">none</property>
- <property name="xalign">0</property>
- <property name="uri"> </property>
- <signal name="clicked" handler="on_more_info_button_clicked"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="tag_box">
- <property name="visible">True</property>
- <property name="left_padding">4</property>
- <property name="right_padding">4</property>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
+ <property name="xalign">0</property>
+ <property name="label">Just an activity</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ <attribute name="size" value="15000"/>
+ </attributes>
</object>
<packing>
+ <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="last_activity_duration">
+ <object class="GtkLabel" id="last_activity_category">
<property name="visible">True</property>
- <property name="no_show_all">True</property>
<property name="xalign">0</property>
- <property name="label">1h 23m</property>
+ <property name="label"> - Work</property>
<attributes>
<attribute name="weight" value="bold"/>
+ <attribute name="size" value="15000"/>
</attributes>
</object>
<packing>
@@ -244,15 +183,13 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="last_activity_description">
+ <object class="GtkAlignment" id="tag_box">
<property name="visible">True</property>
- <property name="no_show_all">True</property>
- <property name="xalign">0</property>
- <property name="label">it's like in case if you need a description, i'll be here</property>
- <property name="wrap">True</property>
- <attributes>
- <attribute name="size" value="10000"/>
- </attributes>
+ <property name="left_padding">4</property>
+ <property name="right_padding">4</property>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="position">2</property>
@@ -264,45 +201,103 @@
</packing>
</child>
<child>
- <object class="GtkAlignment" id="alignment5">
+ <object class="GtkHBox" id="hbox4">
+ <property name="height_request">40</property>
<property name="visible">True</property>
- <property name="yalign">0</property>
- <property name="yscale">0</property>
<child>
- <object class="GtkHButtonBox" id="hbuttonbox1">
+ <object class="GtkVBox" id="activity_info_box">
<property name="visible">True</property>
- <property name="spacing">4</property>
+ <property name="no_show_all">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkButton" id="stop_tracking">
- <property name="label" translatable="yes">St_op tracking</property>
+ <object class="GtkLabel" id="last_activity_duration">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="on_stop_tracking_clicked"/>
+ <property name="xalign">0</property>
+ <property name="label">1h 23m</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
</object>
<packing>
<property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="last_activity_description">
+ <property name="visible">True</property>
+ <property name="no_show_all">True</property>
+ <property name="xalign">0</property>
+ <property name="label">it's like in case if you need a description, i'll be here</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="size" value="10000"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLinkButton" id="more_info_button">
+ <property name="label" translatable="yes">Tell me more</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ <property name="uri"> </property>
</object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="yalign">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkButton" id="stop_tracking">
+ <property name="label" translatable="yes">St_op tracking</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
diff --git a/src/hamster-standalone b/src/hamster-standalone
index 76b6119..9013746 100755
--- a/src/hamster-standalone
+++ b/src/hamster-standalone
@@ -240,19 +240,18 @@ class ProjectHamster(object):
delta = dt.datetime.now() - activity['start_time']
duration = delta.seconds / 60
- self._gui.get_object("more_info_button").hide()
- self.get_widget("last_activity_duration").show()
- self.get_widget("last_activity_description").show()
- self.get_widget("last_activity_category").show()
-
- self.get_widget("last_activity_duration").set_text(stuff.format_duration(duration) or _("Just started"))
-
self.get_widget("last_activity_name").set_text(activity['name'])
if activity['category'] != _("Unsorted"):
self.get_widget("last_activity_category") \
.set_text(" - %s" % activity['category'])
+ self.get_widget("last_activity_category").show()
+
+ self._gui.get_object("more_info_button").hide()
+
+ self.get_widget("last_activity_duration").set_text(stuff.format_duration(duration) or _("Just started"))
self.get_widget("last_activity_description").set_text(activity['description'] or "")
+ self.get_widget("activity_info_box").show()
self.tag_box.draw(activity["tags"])
else:
@@ -260,13 +259,12 @@ class ProjectHamster(object):
self.get_widget("start_tracking").show()
self.get_widget("last_activity_name").set_text(_("No activity"))
+ self.get_widget("last_activity_category").hide()
- self.get_widget("last_activity_duration").hide()
+ self.get_widget("activity_info_box").hide()
self._gui.get_object("more_info_button").show()
- self.get_widget("last_activity_category").hide()
self.tag_box.draw([])
- self.get_widget("last_activity_description").hide()
def delete_selected(self):
diff --git a/src/hamster/applet.py b/src/hamster/applet.py
index 3fe41b4..a4815a7 100755
--- a/src/hamster/applet.py
+++ b/src/hamster/applet.py
@@ -408,19 +408,18 @@ class HamsterApplet(object):
delta = dt.datetime.now() - activity['start_time']
duration = delta.seconds / 60
- self._gui.get_object("more_info_button").hide()
- self.get_widget("last_activity_duration").show()
- self.get_widget("last_activity_description").show()
- self.get_widget("last_activity_category").show()
-
- self.get_widget("last_activity_duration").set_text(stuff.format_duration(duration) or _("Just started"))
-
self.get_widget("last_activity_name").set_text(activity['name'])
if activity['category'] != _("Unsorted"):
self.get_widget("last_activity_category") \
.set_text(" - %s" % activity['category'])
+ self.get_widget("last_activity_category").show()
+
+ self._gui.get_object("more_info_button").hide()
+
+ self.get_widget("last_activity_duration").set_text(stuff.format_duration(duration) or _("Just started"))
self.get_widget("last_activity_description").set_text(activity['description'] or "")
+ self.get_widget("activity_info_box").show()
self.tag_box.draw(activity["tags"])
else:
@@ -428,13 +427,12 @@ class HamsterApplet(object):
self.get_widget("start_tracking").show()
self.get_widget("last_activity_name").set_text(_("No activity"))
+ self.get_widget("last_activity_category").hide()
- self.get_widget("last_activity_duration").hide()
+ self.get_widget("activity_info_box").hide()
self._gui.get_object("more_info_button").show()
- self.get_widget("last_activity_category").hide()
self.tag_box.draw([])
- self.get_widget("last_activity_description").hide()
def delete_selected(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]