24
24
25
25
import operator
26
26
27
- from gi .repository import GObject , Gtk
27
+ from gi .repository import GObject , Gtk , GLib
28
28
29
29
from hamster_gtk import helpers
30
30
from hamster_gtk .misc .dialogs import EditFactDialog
@@ -65,7 +65,7 @@ def _get_date_widget(self, date):
65
65
date_box .set_name ('DayRowDateBox' )
66
66
date_label = Gtk .Label ()
67
67
date_label .set_name ('OverviewDateLabel' )
68
- date_label .set_markup ("<b>{}</b>" .format (GObject .markup_escape_text (date_string )))
68
+ date_label .set_markup ("<b>{}</b>" .format (GLib .markup_escape_text (date_string )))
69
69
date_label .set_valign (Gtk .Align .START )
70
70
date_label .set_justify (Gtk .Justification .RIGHT )
71
71
date_box .add (date_label )
@@ -165,14 +165,14 @@ def _get_time_widget(self, fact):
165
165
""""Return widget to represent ``Fact.start`` and ``Fact.end``."""
166
166
start_time = fact .start .strftime ('%H:%M' )
167
167
end_time = fact .end .strftime ('%H:%M' )
168
- time_label = Gtk .Label ('{start} - {end}' .format (start = start_time , end = end_time ))
168
+ time_label = Gtk .Label (label = '{start} - {end}' .format (start = start_time , end = end_time ))
169
169
time_label .props .valign = Gtk .Align .START
170
170
time_label .props .halign = Gtk .Align .START
171
171
return time_label
172
172
173
173
def _get_delta_widget (self , fact ):
174
174
""""Return widget to represent ``Fact.delta``."""
175
- label = Gtk .Label ('{} Minutes' .format (fact .get_string_delta ()))
175
+ label = Gtk .Label (label = '{} Minutes' .format (fact .get_string_delta ()))
176
176
label .props .valign = Gtk .Align .START
177
177
label .props .halign = Gtk .Align .END
178
178
box = Gtk .EventBox ()
@@ -211,16 +211,16 @@ def _get_activity_widget(self, fact):
211
211
category = str (fact .category )
212
212
activity_label = Gtk .Label ()
213
213
activity_label .set_markup ("{activity} - {category}" .format (
214
- activity = GObject .markup_escape_text (fact .activity .name ),
215
- category = GObject .markup_escape_text (category )))
214
+ activity = GLib .markup_escape_text (fact .activity .name ),
215
+ category = GLib .markup_escape_text (category )))
216
216
activity_label .props .halign = Gtk .Align .START
217
217
return activity_label
218
218
219
219
def _get_tags_widget (self , fact ):
220
220
"""Return widget to represent ``Fact.tags``."""
221
221
def get_tag_widget (name ):
222
222
tag_label = Gtk .Label ()
223
- tag_label .set_markup ("<small>{}</small>" .format (GObject .markup_escape_text (name )))
223
+ tag_label .set_markup ("<small>{}</small>" .format (GLib .markup_escape_text (name )))
224
224
tag_label .set_name ('OverviewTagLabel' )
225
225
tag_box = Gtk .EventBox ()
226
226
tag_box .set_name ('OverviewTagBox' )
@@ -240,6 +240,6 @@ def _get_description_widget(self, fact):
240
240
description_label .set_name ('OverviewDescriptionLabel' )
241
241
description_label .set_line_wrap (True )
242
242
description_label .set_markup ("<small><i>{}</i></small>" .format (
243
- GObject .markup_escape_text (fact .description )))
243
+ GLib .markup_escape_text (fact .description )))
244
244
description_label .props .halign = Gtk .Align .START
245
245
return description_label
0 commit comments