def build(self): title = wal.DecorLabel(self, self.title, 1, True) self.pack_start(title, False, False, 0) self.pack_start(wal.HLine(self), False, False, 5) self.built = True self.set_border_width(5) self.set_size_request(400, -1)
def __init__(self, master, owner, app, dlg): self.owner = owner PrefsTab.__init__(self, master, app, dlg) self.set_border_width(0) self.use_cms = config.cms_use hbox = wal.HBox(self) txt = _('Activate Color Management') self.cms_check = wal.CheckButton(hbox, txt, self.use_cms, self.changes) hbox.pack(self.cms_check, padding=10) self.pack(hbox, padding=5) self.container = wal.HidableVBox(hbox) self.splash = wal.ImgPlate(self.container, rc.IMG_PREFS_CMS_BANNER, bg=wal.DARK_GRAY) self.container.pack(self.splash, True, True) self.container.set_visible(self.use_cms) self.pack(self.container) hbox = wal.HBox(self) txt = _( 'Note: If Color Management is not activated all colors ' 'will be processed using simple calculation procedures. Therefore ' 'resulted color values will be not accurate.') note = wal.DecorLabel(hbox, txt, -1, enabled=False, wrap=True) note.set_width(450) hbox.pack(note, padding=10) self.pack(hbox, padding=5)
def __init__(self): wal.MainWindow.__init__(self) self.set_size(300, 200) self.pack(wal.Label(self, 'Test Label'), padding=10) self.pack(wal.DecorLabel(self, 'Test DecorLabel', italic=True), padding=10) self.pack(wal.DecorLabel(self, 'Test DecorLabel', italic=True, bold=True), padding=10) self.pack(wal.DecorLabel(self, 'Test DecorLabel', bold=True), padding=10) self.pack(wal.DecorLabel(self, 'Test DecorLabel', size=-1), padding=10) self.pack(wal.DecorLabel(self, 'Test DecorLabel', size=1), padding=10) self.pack(wal.DecorLabel(self, 'Test DecorLabel', size=1, bold=True), padding=10) self.pack(wal.DecorLabel(self, 'Test DecorLabel', enabled=False), padding=10) self.pack(wal.URL_Label(self, 'http://sk1project.org'), padding=10) self.pack(wal.URL_Label(self, 'http://inkscape.org', tooltip='Home site'), padding=10)
def __init__(self, app, master): self.app = app wal.HBox.__init__(self, master) self.set_border_width(2) self.pager = PagerWidget(self.app, self) self.pack(self.pager, padding=5) self.msg_label = wal.DecorLabel(self) self.pack(self.msg_label) self.cmw = ColorMonitorWidget(self.app, self) self.pack(self.cmw, end=True) events.connect(events.APP_STATUS, self.show_message)
def __init__(self, app, master): wal.HBox.__init__(self, master) self.app = app self.insp = app.inspector self.start = wal.ImgButton(self, rc.IMG_PAGER_START, cmd=self.first_page, flat=True) self.pack(self.start) self.left = wal.ImgButton(self, rc.IMG_PAGER_PREV, cmd=self.prev_page, flat=True) self.pack(self.left) self.label = wal.DecorLabel(self) self.pack(self.label, False, False, 5) self.right = wal.ImgButton(self, rc.IMG_PAGER_NEXT, cmd=self.next_page, flat=True) self.pack(self.right) self.end = wal.ImgButton(self, rc.IMG_PAGER_END, cmd=self.last_page, flat=True) self.pack(self.end) self.pack(wal.VLine(self)) self.update_pager() events.connect(events.DOC_CHANGED, self.update_pager) events.connect(events.DOC_MODIFIED, self.update_pager)
def __init__(self, master, app, dlg): PrefsTab.__init__(self, master, app, dlg) title = wal.DecorLabel(self, _('Document related profiles'), bold=True) self.pack(title) self.pack(wal.HLine(self), padding=5) tab = gtk.Table(9, 3, False) tab.set_row_spacings(5) tab.set_col_spacings(10) self.pack(tab, True, True) self.cs_widgets = {} self.cs_profiles = {} self.cs_config_profiles = {} self.cs_config = { COLOR_RGB: config.default_rgb_profile, COLOR_CMYK: config.default_cmyk_profile, COLOR_LAB: config.default_lab_profile, COLOR_GRAY: config.default_gray_profile, COLOR_DISPLAY: config.cms_display_profile } index = 0 for colorspace in COLORSPACES[:-1]: label = gtk.Label(_('%s profile:') % (colorspace)) label.set_alignment(0, 0.5) tab.attach(label, 0, 1, index, index + 1, gtk.FILL, gtk.SHRINK) combo = wal.ComboBoxText(tab) self.cs_widgets[colorspace] = combo tab.attach(combo, 1, 2, index, index + 1, gtk.FILL | gtk.EXPAND, gtk.SHRINK) self.update_combo(colorspace) button = ManageButton(tab, self, colorspace) tab.attach(button, 2, 3, index, index + 1, gtk.SHRINK, gtk.SHRINK) index += 1 title = wal.DecorLabel(tab, _('Application related profile'), bold=True) tab.attach(title, 0, 3, 5, 6, gtk.FILL, gtk.SHRINK) line = wal.HLine(tab) tab.attach(line, 0, 3, 6, 7, gtk.FILL, gtk.SHRINK) colorspace = COLOR_DISPLAY label = gtk.Label(_('%s profile:') % (colorspace)) label.set_alignment(0, 0.5) tab.attach(label, 0, 1, 7, 8, gtk.FILL, gtk.SHRINK) combo = wal.ComboBoxText(tab) self.cs_widgets[colorspace] = combo tab.attach(combo, 1, 2, 7, 8, gtk.FILL | gtk.EXPAND, gtk.SHRINK) self.update_combo(colorspace) button = ManageButton(tab, self, colorspace) tab.attach(button, 2, 3, 7, 8, gtk.SHRINK, gtk.SHRINK) text = _('Note: Display profile affects on ' 'document screen representation only. The profile for your ' 'hardware you can get either from monitor manufacture or ' 'calibrating monitor (prefered option) or download ' 'from ICC Profile Taxi service: http://icc.opensuse.org/') note = wal.DecorLabel(tab, text, -1, enabled=False, wrap=True) note.set_width(430) tab.attach(note, 0, 2, 8, 9, gtk.FILL | gtk.EXPAND, gtk.SHRINK) button = TaxiButton(tab, self.app) tab.attach(button, 2, 3, 8, 9, gtk.SHRINK, gtk.SHRINK)
def build(self): GenericPrefsPlugin.build(self) self.test_ruler = TestRuler(self) tab = gtk.Table(1, 1, False) tab.set_row_spacings(5) tab.set_col_spacings(10) tab.set_border_width(5) #--- Ruler size al = gtk.Alignment(1.0, 0.5) al.add(gtk.Label(_('Ruler size (px):'))) tab.attach(al, 0, 1, 0, 1, gtk.FILL, gtk.SHRINK) self.size_spin = wal.SpinButtonInt(tab, config.ruler_size, (15, 30), cmd=self.test_ruler.redraw, check_enter=False) al = gtk.Alignment(0.0, 0.5) al.add(self.size_spin) tab.attach(al, 1, 2, 0, 1, gtk.FILL, gtk.SHRINK) #--- Ruler font size al = gtk.Alignment(1.0, 0.5) al.add(gtk.Label(_('Ruler font size (px):'))) tab.attach(al, 0, 1, 1, 2, gtk.FILL, gtk.SHRINK) self.fsize_spin = wal.SpinButtonInt(tab, config.ruler_font_size, (5, 8), cmd=self.test_ruler.redraw, check_enter=False) al = gtk.Alignment(0.0, 0.5) al.add(self.fsize_spin) tab.attach(al, 1, 2, 1, 2, gtk.FILL, gtk.SHRINK) #--- Background color al = gtk.Alignment(1.0, 0.5) al.add(gtk.Label(_('Ruler background color:'))) tab.attach(al, 0, 1, 2, 3, gtk.FILL, gtk.SHRINK) self.bgcolor = wal.ColorButton(tab, config.ruler_bgcolor, cmd=self.test_ruler.redraw) al = gtk.Alignment(0.0, 0.5) al.add(self.bgcolor) tab.attach(al, 1, 2, 2, 3, gtk.FILL, gtk.SHRINK) #--- Foreground color al = gtk.Alignment(1.0, 0.5) al.add(gtk.Label(_('Ruler tick color:'))) tab.attach(al, 0, 1, 3, 4, gtk.FILL, gtk.SHRINK) self.fgcolor = wal.ColorButton(tab, config.ruler_fgcolor, cmd=self.test_ruler.redraw) al = gtk.Alignment(0.0, 0.5) al.add(self.fgcolor) tab.attach(al, 1, 2, 3, 4, gtk.FILL, gtk.SHRINK) #--- Small tick size al = gtk.Alignment(1.0, 0.5) al.add(gtk.Label(_('Small tick size (px):'))) tab.attach(al, 0, 1, 4, 5, gtk.FILL, gtk.SHRINK) self.stick_spin = wal.SpinButtonInt(tab, config.ruler_small_tick, (1, 30), cmd=self.test_ruler.redraw, check_enter=False) al = gtk.Alignment(0.0, 0.5) al.add(self.stick_spin) tab.attach(al, 1, 2, 4, 5, gtk.FILL, gtk.SHRINK) #--- Large tick size al = gtk.Alignment(1.0, 0.5) al.add(gtk.Label(_('Large tick size (px):'))) tab.attach(al, 0, 1, 5, 6, gtk.FILL, gtk.SHRINK) self.ltick_spin = wal.SpinButtonInt(tab, config.ruler_text_tick, (1, 30), cmd=self.test_ruler.redraw, check_enter=False) al = gtk.Alignment(0.0, 0.5) al.add(self.ltick_spin) tab.attach(al, 1, 2, 5, 6, gtk.FILL, gtk.SHRINK) #--- Text mark shift al = gtk.Alignment(1.0, 0.5) al.add(gtk.Label(_('Text mark shift (px):'))) tab.attach(al, 0, 1, 6, 7, gtk.FILL, gtk.SHRINK) self.tmshift_spin = wal.SpinButtonInt(tab, config.ruler_text_shift, (-30, 30), cmd=self.test_ruler.redraw, check_enter=False) al = gtk.Alignment(0.0, 0.5) al.add(self.tmshift_spin) tab.attach(al, 1, 2, 6, 7, gtk.FILL, gtk.SHRINK) self.pack_start(tab, False, False, 0) #--- Testing ruler al = wal.DecorLabel(self, _('Testing ruler:'), bold=True) self.pack_start(al, False, False, 20) self.pack_start(gtk.HSeparator(), False, False, 0) self.pack_start(self.test_ruler, False, False, 0)