From 7a6ea32a02bec001495e6fc8f7ceb4265bb9d6e9 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 22 Jan 2009 20:52:32 +0000 Subject: make cardtable screen-resolution independent --- (limited to 'createcardpanel.py') diff --git a/createcardpanel.py b/createcardpanel.py index a166252..3034586 100644 --- a/createcardpanel.py +++ b/createcardpanel.py @@ -52,7 +52,7 @@ class CreateCardPanel(gtk.EventBox): self._addbutton.set_image(add_image) self._addbutton.connect('pressed', self.emit_add_pair) self._addbutton.set_size_request( - theme.CARD_SIZE + theme.CARD_PAD*4, -1) + theme.PAIR_SIZE + theme.PAIR_PAD*4, -1) # Set update selected pair buttom update_icon = join(dirname(__file__), 'images', 'pair-update.svg') @@ -62,7 +62,7 @@ class CreateCardPanel(gtk.EventBox): self._updatebutton.set_image(update_image) self._updatebutton.connect('pressed', self.emit_update_pair) self._updatebutton.set_size_request( - theme.CARD_SIZE + theme.CARD_PAD*4, -1) + theme.PAIR_SIZE + theme.PAIR_PAD*4, -1) # Set card editors self.cardeditor1 = CardEditor() @@ -76,9 +76,9 @@ class CreateCardPanel(gtk.EventBox): # Create table and add components to the table self.table = gtk.Table() self.table.set_homogeneous(False) - self.table.set_col_spacings(theme.CARD_PAD) - self.table.set_row_spacings(theme.CARD_PAD) - self.table.set_border_width(theme.CARD_PAD) + self.table.set_col_spacings(theme.PAIR_PAD) + self.table.set_row_spacings(theme.PAIR_PAD) + self.table.set_border_width(theme.PAIR_PAD) self.table.attach(self.cardeditor1, 0, 1, 0, 1, yoptions=gtk.SHRINK) self.table.attach(self.cardeditor2, 1, 2, 0, 1, yoptions=gtk.SHRINK) self.table.attach(self._addbutton, 0, 1, 1, 2, yoptions=gtk.SHRINK) @@ -203,21 +203,21 @@ class CardEditor(gtk.EventBox): self.textentry.connect('changed', self.update_text) table.set_homogeneous(False) - table.set_col_spacings(theme.CARD_PAD) - table.set_row_spacings(theme.CARD_PAD) - table.set_border_width(theme.CARD_PAD) + table.set_col_spacings(theme.PAIR_PAD) + table.set_row_spacings(theme.PAIR_PAD) + table.set_border_width(theme.PAIR_PAD) self.card = svgcard.SvgCard(-1, { 'front_text' : { 'card_text' : '', 'text_color' : '#ffffff' }, 'front_border': { 'fill_color' : '#4c4d4f', 'stroke_color' : '#ffffff', 'opacity' : '1' } }, - None, theme.CARD_SIZE, 1, '#c0c0c0') + None, theme.PAIR_SIZE, 1, '#c0c0c0') self.card.flip() table.attach(self.previewlabel, 0, 2, 0, 1, yoptions=gtk.SHRINK) table.attach(self.card, 0, 2, 1, 2, gtk.SHRINK, gtk.SHRINK, - theme.CARD_PAD) + theme.PAIR_PAD) #Text label and entry table.attach(self.textlabel, 0, 1, 2, 3, yoptions=gtk.SHRINK) table.attach(self.textentry, 0, 2, 3, 4, yoptions=gtk.SHRINK) @@ -265,8 +265,8 @@ class CardEditor(gtk.EventBox): def _load_image(self, index): pixbuf_t = gtk.gdk.pixbuf_new_from_file_at_size(index, - theme.CARD_SIZE - theme.CARD_PAD*2, - theme.CARD_SIZE - theme.CARD_PAD*2) + theme.PAIR_SIZE - theme.PAIR_PAD*2, + theme.PAIR_SIZE - theme.PAIR_PAD*2) self.card.set_pixbuf(pixbuf_t) _logger.error('Picture Loaded: '+index) self.emit('has-picture', True) -- cgit v0.9.1