diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2014-07-16 14:17:41 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2014-07-16 14:17:41 (GMT) |
commit | 56c457367b1c4628abd9e04b73119118412ab87c (patch) | |
tree | 3538edb36786c8470e692d4d6527398b8f45ddfe | |
parent | 3b869ff86859a0f9365f0ce4efe95877085865e4 (diff) |
Improve sizes and spacing on edition screen
-rw-r--r-- | activity.py | 4 | ||||
-rw-r--r-- | cardlist.py | 19 | ||||
-rw-r--r-- | createcardpanel.py | 7 |
3 files changed, 16 insertions, 14 deletions
diff --git a/activity.py b/activity.py index 929b869..94a45ab 100644 --- a/activity.py +++ b/activity.py @@ -339,8 +339,8 @@ class MemorizeActivity(Activity): self.box.remove(self.scoreboard) self.box.remove(self.table) - self.box.pack_start(self.createcardpanel, False, False, 0) - self.box.pack_start(self.cardlist, True, True, 0) + self.box.pack_start(self.createcardpanel, True, True, 0) + self.box.pack_start(self.cardlist, False, False, 0) self.cardlist.load_game(self.game) self.game.model.create_temp_directories() self.createcardpanel.set_temp_folder( diff --git a/cardlist.py b/cardlist.py index e99b14e..18dee84 100644 --- a/cardlist.py +++ b/cardlist.py @@ -66,6 +66,7 @@ class CardList(Gtk.EventBox): self._scroll.get_child().modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse('#000000')) self.add(self._scroll) + self.set_size_request(-1, PAIR_SIZE * 2 + style.DEFAULT_SPACING * 4) self.show_all() def load_game(self, game): @@ -262,7 +263,7 @@ class CardPair(Gtk.EventBox): font_name1=None, font_name2=None, aimg_name=None, bimg_name=None): Gtk.EventBox.__init__(self) - self.bg_color = '#000000' + self.bg_color = '#d7d7d7' self.asnd = asnd self.bsnd = bsnd @@ -273,8 +274,8 @@ class CardPair(Gtk.EventBox): self.current_game_key = None row = Gtk.VBox() - row.props.border_width = 10 - row.props.spacing = 10 + row.props.margin_left = style.DEFAULT_SPACING + row.props.margin_right = style.DEFAULT_SPACING self.bcard1 = svgcard.SvgCard( -1, {'front_text': {'card_text': text1, @@ -285,9 +286,8 @@ class CardPair(Gtk.EventBox): None, PAIR_SIZE, self.bg_color, font_name1) self.bcard1.flip() self.bcard1.set_pixbuf(aimg) - align = Gtk.Alignment.new(.5, .5, 0, 0) - align.add(self.bcard1) - row.pack_start(align, True, True, 0) + self.bcard1.set_valign(Gtk.Align.CENTER) + row.pack_start(self.bcard1, True, True, 0) self.bcard2 = svgcard.SvgCard( -1, {'front_text': {'card_text': text2, @@ -298,9 +298,8 @@ class CardPair(Gtk.EventBox): None, PAIR_SIZE, self.bg_color, font_name2) self.bcard2.flip() self.bcard2.set_pixbuf(bimg) - align = Gtk.Alignment.new(.5, .5, 0, 0) - align.add(self.bcard2) - row.pack_start(align, True, True, 0) + self.bcard2.set_valign(Gtk.Align.CENTER) + row.pack_start(self.bcard2, True, True, 0) self.connect('button-press-event', self.emit_selected) self.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse(self.bg_color)) self.add(row) @@ -311,7 +310,7 @@ class CardPair(Gtk.EventBox): def set_selected(self, status): if not status: - self.bg_color = '#000000' + self.bg_color = '#d7d7d7' else: self.bg_color = '#b2b3b7' diff --git a/createcardpanel.py b/createcardpanel.py index e8e041e..2a307e8 100644 --- a/createcardpanel.py +++ b/createcardpanel.py @@ -43,7 +43,7 @@ import speak.widgets import speak.face _logger = logging.getLogger('memorize-activity') -PAIR_SIZE = min(Gdk.Screen.width() / 5, Gdk.Screen.height() / 3) +PAIR_SIZE = min(Gdk.Screen.width() / 4, Gdk.Screen.height() / 3) class CreateCardPanel(Gtk.EventBox): @@ -83,6 +83,7 @@ class CreateCardPanel(Gtk.EventBox): buttons_bar = Gtk.VBox() buttons_bar.props.border_width = 10 buttons_bar.set_valign(Gtk.Align.CENTER) + buttons_bar.set_halign(Gtk.Align.CENTER) self._addbutton = ToolButton(tooltip=_('Add as new pair'), sensitive=False) @@ -124,13 +125,15 @@ class CreateCardPanel(Gtk.EventBox): self.card_box = Gtk.HBox() self.card_box.set_homogeneous(True) self.cardeditor1.set_halign(Gtk.Align.CENTER) + self.cardeditor1.set_valign(Gtk.Align.CENTER) self.cardeditor2.set_halign(Gtk.Align.CENTER) + self.cardeditor2.set_valign(Gtk.Align.CENTER) self.card_box.pack_start(self.cardeditor1, True, True, 0) self.card_box.pack_start(self.cardeditor2, True, True, 0) box = Gtk.HBox() box.pack_start(self.card_box, True, True, 0) - box.pack_start(buttons_bar, False, False, 0) + box.pack_start(buttons_bar, True, True, 0) self.add(box) self.show_all() |