Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/gui/frame.py
diff options
context:
space:
mode:
Diffstat (limited to 'gui/frame.py')
-rw-r--r--gui/frame.py56
1 files changed, 28 insertions, 28 deletions
diff --git a/gui/frame.py b/gui/frame.py
index 365797a..d76429b 100644
--- a/gui/frame.py
+++ b/gui/frame.py
@@ -20,7 +20,7 @@
import gi
from gi.repository import GObject
from gi.repository import Gtk
-import hippo
+from gi.repository import Hippo
import logging
from gettext import gettext as _
@@ -36,15 +36,15 @@ import pages.edit
from persistence.jokebook import Jokebook
from gui.lessonplanwidget import LessonPlanWidget
-class Frame(hippo.Canvas):
+class Frame(Hippo.Canvas):
def __init__(self):
- hippo.Canvas.__init__(self)
+ gobject.GObject.__init__(self)
# Root Frame ###############################################################
# Holds: Everything
- self.__root = hippo.CanvasBox(
- orientation=hippo.ORIENTATION_VERTICAL)
+ self.__root = Hippo.CanvasBox(
+ orientation=Hippo.Orientation.VERTICAL)
self.set_root(self.__root)
# Application Header #######################################################
@@ -54,7 +54,7 @@ class Frame(hippo.Canvas):
# Page Container ###########################################################
# Holds: The currently open UI page
- self.__container = hippo.CanvasBox(border=theme.BORDER_WIDTH,
+ self.__container = Hippo.CanvasBox(border=theme.BORDER_WIDTH,
border_color=theme.COLOR_FRAME.get_int(),
background_color=theme.COLOR_BACKGROUND.get_int(),
spacing=4,
@@ -62,16 +62,16 @@ class Frame(hippo.Canvas):
padding_left=40,
padding_right=40,
padding_bottom=20,
- orientation=hippo.ORIENTATION_VERTICAL)
- self.__root.append(self.__container, hippo.PACK_EXPAND)
+ orientation=Hippo.Orientation.VERTICAL)
+ self.__root.append(self.__container, Hippo.PackFlags.EXPAND)
- self.__page = hippo.CanvasBox(background_color=theme.COLOR_PAGE.get_int(),
+ self.__page = Hippo.CanvasBox(background_color=theme.COLOR_PAGE.get_int(),
border=4,
border_color=theme.COLOR_PAGE_BORDER.get_int(),
spacing=8,
padding=20,
- orientation=hippo.ORIENTATION_VERTICAL)
- self.__container.append(self.__page, hippo.PACK_EXPAND)
+ orientation=Hippo.Orientation.VERTICAL)
+ self.__container.append(self.__page, Hippo.PackFlags.EXPAND)
self.__page_class = None
@@ -83,16 +83,16 @@ class Frame(hippo.Canvas):
def __make_header(self):
- ret = hippo.CanvasBox(
- orientation=hippo.ORIENTATION_HORIZONTAL)
+ ret = Hippo.CanvasBox(
+ orientation=Hippo.Orientation.HORIZONTAL)
# logo
logo = Gtk.Image()
logo.set_from_file(Globals.logo)
- ret.append(hippo.CanvasWidget(widget=logo))
+ ret.append(Hippo.CanvasWidget(widget=logo))
# lesson plans
- lesson_plans = hippo.CanvasWidget(background_color=theme.COLOR_BACKGROUND.get_int(),
+ lesson_plans = Hippo.CanvasWidget(background_color=theme.COLOR_BACKGROUND.get_int(),
border_top=theme.BORDER_WIDTH,
border_left=theme.BORDER_WIDTH,
border_right=theme.BORDER_WIDTH,
@@ -101,33 +101,33 @@ class Frame(hippo.Canvas):
padding_bottom=12,
padding_left=30,
padding_right=30,
- yalign=hippo.ALIGNMENT_CENTER,
- orientation=hippo.ORIENTATION_VERTICAL)
+ yalign=Hippo.ALIGNMENT_CENTER,
+ orientation=Hippo.Orientation.VERTICAL)
button = Gtk.Button(_('Lesson Plans'))
button.set_size_request(200, -1)
button.active = False
button.connect('clicked', self.__do_clicked_lessonplans)
lesson_plans.props.widget = theme.theme_widget(button)
- ret.append(lesson_plans, hippo.PACK_EXPAND)
+ ret.append(lesson_plans, Hippo.PackFlags.EXPAND)
return ret
def __make_footer(self):
- ret = hippo.CanvasBox(
+ ret = Hippo.CanvasBox(
padding_right=8,
padding_top=8,
padding_bottom=0,
spacing=8,
- orientation=hippo.ORIENTATION_HORIZONTAL)
+ orientation=Hippo.Orientation.HORIZONTAL)
button = Gtk.Button(_('Read Jokebooks'))
button.connect('clicked', self.__do_clicked_read)
- self.__button_read = hippo.CanvasWidget(widget=theme.theme_widget(button))
+ self.__button_read = Hippo.CanvasWidget(widget=theme.theme_widget(button))
ret.append(self.__button_read)
button = Gtk.Button(_('Make Jokebook'))
button.connect('clicked', self.__do_clicked_make)
- self.__button_make = hippo.CanvasWidget(widget=theme.theme_widget(button))
+ self.__button_make = Hippo.CanvasWidget(widget=theme.theme_widget(button))
ret.append(self.__button_make)
return ret
@@ -148,7 +148,7 @@ class Frame(hippo.Canvas):
def set(self, value):
self.__page_class = type(value)
self.__page.clear()
- self.__page.append(value, hippo.PACK_EXPAND)
+ self.__page.append(value, Hippo.PackFlags.EXPAND)
# some rules for the buttons in the footer
if not Globals.JokeMachineActivity.is_initiator \
@@ -196,16 +196,16 @@ class Frame(hippo.Canvas):
else:
button.set_label(_('Close Lessons'))
button.active = True
- widget_box = hippo.CanvasBox(border=0,
+ widget_box = Hippo.CanvasBox(border=0,
border_color=theme.COLOR_BLUE.get_int())
- widget_box.append(hippo.CanvasText(text= _('Lesson Plans:'),
- xalign=hippo.ALIGNMENT_START,
+ widget_box.append(Hippo.CanvasText(text= _('Lesson Plans:'),
+ xalign=Hippo.ALIGNMENT_START,
padding=10))
lesson_plans = LessonPlanWidget(Globals.pwd)
- widget_box.append(hippo.CanvasWidget(widget=lesson_plans,
+ widget_box.append(Hippo.CanvasWidget(widget=lesson_plans,
border=0,
border_color=theme.COLOR_DARK_GREEN.get_int()),
- hippo.PACK_EXPAND)
+ Hippo.PackFlags.EXPAND)
self.page = widget_box
self.__button_read.set_visible(False)
self.__button_make.set_visible(False)