Esempio n. 1
0
    def __init__(self, parent, prefpanel):
        CmsTab.__init__(self, parent, prefpanel)

        txt = _('Colorspace profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, rows=10, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        self.cs_widgets = {}
        self.cs_profiles = {}
        self.cs_config_profiles = {}

        self.cs_config = {COLOR_RGB: config.cms_rgb_profile,
                          COLOR_CMYK: config.cms_cmyk_profile,
                          COLOR_LAB: config.cms_lab_profile,
                          COLOR_GRAY: config.cms_gray_profile,
                          COLOR_DISPLAY: config.cms_display_profile}

        for colorspace in COLORSPACES[:-1]:
            txt = _('%s profile:') % colorspace
            grid.pack(wal.Label(grid, txt))
            combo = wal.Combolist(grid, items=[])
            self.cs_widgets[colorspace] = combo
            grid.pack(combo, fill=True)
            self.update_combo(colorspace)
            grid.pack(ManageButton(grid, self, colorspace))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Hardware profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        txt = _('Display profile:')
        grid.pack(wal.Label(grid, txt))
        combo = wal.Combolist(grid, items=[])
        self.cs_widgets[COLOR_DISPLAY] = combo
        grid.pack(combo, fill=True)
        self.update_combo(COLOR_DISPLAY)
        grid.pack(ManageButton(grid, self, COLOR_DISPLAY))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Use display profile')
        self.display_check = wal.Checkbox(self, txt,
                                          config.cms_use_display_profile,
                                          onclick=self.activate_display)
        self.pack(self.display_check, align_center=False)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        txt = _('Note: Display profile for your hardware you could fetch here:')
        label = wal.Label(self, txt, fontsize=-1)
        self.pack(label, fill=True, padding_all=5)
        self.pack(wal.HtmlLabel(self, 'http://icc.opensuse.org/'))
        self.activate_display()
Esempio n. 2
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)
        self.panel.pack((5, 5))
        self.shaping_keeper = wal.HToggleKeeper(self.panel, SHAPING_MODES,
                                                SHAPING_MODE_ICONS,
                                                SHAPING_MODE_NAMES,
                                                self.on_mode_change)
        self.panel.pack(self.shaping_keeper)
        self.panel.pack(wal.HLine(self.panel), fill=True, padding=3)

        self.shaping_panel = wal.VPanel(self.panel)

        self.panels = {}
        for item in SHAPING_MODES:
            panel = SHAPING_CLASSES[item](self.shaping_panel, self.app)
            panel.hide()
            self.panels[item] = panel

        self.panel.pack(self.shaping_panel, fill=True, padding_all=5)
        self.panel.pack(wal.HLine(self.panel), fill=True)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.SELECTION_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)
        self.update()
Esempio n. 3
0
	def build(self):
		panel = wal.HPanel(self)
		self.pattern_clrs = wal.HToggleKeeper(panel, GRADIENT_CLR_MODES,
								GRADIENT_CLR_ICONS,
								GRADIENT_CLR_NAMES, self.on_clr_mode_change)
		panel.pack(self.pattern_clrs)
		panel.pack(wal.HPanel(panel), fill=True, expand=True)

		self.rule_keeper = FillRuleKeeper(panel)
		panel.pack(self.rule_keeper)
		self.pack(panel, fill=True, padding_all=5)
		self.pack(wal.HLine(self), fill=True)

		default_pattern_def = [sk2_const.PATTERN_IMG, '' + DEFAULT_PATTERN,
					deepcopy([sk2_const.CMYK_BLACK, sk2_const.CMYK_WHITE]),
					[] + sk2_const.NORMAL_TRAFO]
		self.pattern_editor = PatternEditor(self, self.dlg, self.cms,
						default_pattern_def, onchange=self.on_pattern_change)
		self.pack(self.pattern_editor, fill=True, expand=True, padding_all=5)


		self.pack(wal.HLine(self), fill=True)

		panel = wal.HPanel(self)
		self.refpanel = FillFillRefPanel(self, self.cms, self.orig_fill,
						deepcopy(self.orig_fill), on_orig=self.set_orig_fill)
		panel.pack(self.refpanel)

		panel.pack(wal.HPanel(panel), fill=True, expand=True)

		self.presets = PatternMiniPalette(panel, self.cms,
										onclick=self.on_presets_select)
		panel.pack(self.presets)
		self.pack(panel, fill=True, padding_all=5)
Esempio n. 4
0
	def build(self):
		panel = wal.HPanel(self)
		self.grad_keeper = wal.HToggleKeeper(panel, GRADIENT_MODES,
								GRADIENT_MODE_ICONS,
								GRADIENT_MODE_NAMES, self.on_grad_mode_change)
		panel.pack(self.grad_keeper)
		panel.pack(wal.HPanel(panel), fill=True, expand=True)

		self.grad_clrs = wal.HToggleKeeper(panel, GRADIENT_CLR_MODES,
								GRADIENT_CLR_ICONS,
								GRADIENT_CLR_NAMES, self.on_clr_mode_change)
		panel.pack(self.grad_clrs)
		panel.pack(wal.HPanel(panel), fill=True, expand=True)

		self.rule_keeper = FillRuleKeeper(panel)
		panel.pack(self.rule_keeper)
		self.pack(panel, fill=True, padding_all=5)
		self.pack(wal.HLine(self), fill=True)

		self.grad_editor = GradientEditor(self, self.dlg, self.cms,
								DEFAULT_STOPS, onchange=self.on_stops_change)
		self.pack(self.grad_editor, fill=True, expand=True, padding=3)
		self.pack(wal.HLine(self), fill=True)

		panel = wal.HPanel(self)
		self.refpanel = FillFillRefPanel(self, self.cms, self.orig_fill,
						deepcopy(self.orig_fill), on_orig=self.set_orig_fill)
		panel.pack(self.refpanel)

		panel.pack(wal.HPanel(panel), fill=True, expand=True)

		self.presets = GradientMiniPalette(panel, self.cms,
										onclick=self.on_presets_select)
		panel.pack(self.presets)
		self.pack(panel, fill=True, padding_all=5)
Esempio n. 5
0
    def build(self):
        self.app.actions = self.actions
        self.app.mw = self

        self.mb = AppMenubar(self)
        self.toolbar = AppToolbar(self)

        #---CENTRAL PART
        self.workarea = wal.HidableVArea(self)

        self.workarea.pack(wal.HLine(self.workarea))
        self.workarea.pack(ContextPanel(self.app, self.workarea))
        self.workarea.pack(wal.HLine(self.workarea))

        hbox = wal.HBox(self.workarea)
        self.tools = AppTools(self.app, hbox)
        hbox.pack(self.tools, padding=1)
        self.inner_hpaned = gtk.HPaned()

        self.nb = gtk.Notebook()
        self.nb.connect('switch-page', self.change_doc)
        self.nb.set_property('scrollable', True)
        self.inner_hpaned.pack1(self.nb, 1, 0)

        self.plugin_panel = PluginPanel(self)
        hbox.pack(self.inner_hpaned, True, True, padding=1)

        self.vpalette = VPalette(self.workarea, self.app)
        hbox.pack(self.vpalette, padding=2)
        self.workarea.pack(hbox, True, True)

        #---SPLASH
        self.nb_splash = Splash(self.workarea)
        self.workarea.pack2(self.nb_splash, True, True)

        self.hpalette = HPalette(self.workarea, self.app)
        self.workarea.pack(self.hpalette, padding=2)

        self.workarea.pack(wal.HLine(self.workarea))

        self.statusbar = AppStatusbar(self.app, self.workarea)
        self.workarea.pack(self.statusbar)

        #---CENTRAL PART END

        self.pack(self.workarea, True, True)

        self.set_win_title()
        self.set_min_size(*config.mw_min_size)
        if config.mw_store_size: self.set_size(*config.mw_size)

        self.set_icon(rc.IMG_APP_ICON)
        self.center()

        if config.mw_maximized: self.maximize()
Esempio n. 6
0
    def build(self):
        self.panels = {}
        panel = wal.HPanel(self)
        self.solid_keeper = wal.HToggleKeeper(panel, SOLID_MODES,
                                              SOLID_MODE_ICONS,
                                              SOLID_MODE_NAMES,
                                              self.on_mode_change)
        panel.pack(self.solid_keeper)
        panel.pack(wal.HPanel(panel), fill=True, expand=True)
        self.rule_keeper = FillRuleKeeper(panel)
        panel.pack(self.rule_keeper)
        if not self.use_rule:
            self.rule_keeper.set_visible(False)
        self.pack(panel, fill=True, padding_all=5)
        self.pack(wal.HLine(self), fill=True)

        for item in SOLID_MODES:
            self.panels[item] = SOLID_MODE_CLASSES[item](self, self.app)
            if wal.IS_MSW:
                self.pack(self.panels[item],
                          fill=True,
                          expand=True,
                          padding_all=5)
                self.layout()
                self.panels[item].hide()
                self.remove(self.panels[item])
            else:
                self.panels[item].hide()
Esempio n. 7
0
    def build(self):
        self.pack(wal.HPanel(self), fill=True, expand=True)

        cs = self.orig_color[0]
        self.mixer = MIXERS[cs](self, self.cms, onchange=self.mixer_changed)
        self.pack(self.mixer)

        self.pack(wal.HPanel(self), fill=True, expand=True)

        self.pack(wal.HLine(self), fill=True, padding=5)

        hpanel = wal.HPanel(self)

        self.refpanel = ColorColorRefPanel(hpanel,
                                           self.cms,
                                           self.orig_color,
                                           self.new_color,
                                           on_orig=self.refpanel_click)
        hpanel.pack(self.refpanel)

        hpanel.pack(wal.HPanel(hpanel), fill=True, expand=True)

        self.palette = MiniPalette(hpanel,
                                   self.cms,
                                   PALETTES[cs],
                                   onclick=self.palette_click)
        hpanel.pack(self.palette)

        self.pack(hpanel, fill=True)
        self.update_data()
Esempio n. 8
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)
        self.panel.pack(wal.Label(self.panel, _('Layers'), fontbold=True),
                        padding=3)
        self.panel.pack(wal.HLine(self.panel), fill=True)

        pnl = wal.HPanel(self.panel)
        self.layer_new = wal.ImageButton(pnl,
                                         icons.PD_LAYER_NEW,
                                         tooltip=_('Create new layer'),
                                         onclick=self.new_layer)
        self.layer_to_bottom = wal.ImageButton(
            pnl,
            icons.PD_LOWER_TO_BOTTOM,
            tooltip=_('Move layer to bottom'),
            onclick=self.lower_layer_to_bottom)
        self.layer_lower = wal.ImageButton(pnl,
                                           icons.PD_LOWER,
                                           tooltip=_('Move layer down'),
                                           onclick=self.lower_layer)
        self.layer_raise = wal.ImageButton(pnl,
                                           icons.PD_RAISE,
                                           tooltip=_('Move layer up'),
                                           onclick=self.raise_layer)
        self.layer_to_top = wal.ImageButton(pnl,
                                            icons.PD_RAISE_TO_TOP,
                                            tooltip=_('Move layer to top'),
                                            onclick=self.raise_layer_to_top)
        self.layer_delete = wal.ImageButton(pnl,
                                            icons.PD_LAYER_DELETE,
                                            tooltip=_('Delete layer'),
                                            onclick=self.delete_layer)
        self.layer_edit = wal.ImageButton(pnl,
                                          icons.PD_EDIT,
                                          tooltip=_('Rename layer'),
                                          onclick=self.rename_layer)
        pnl.pack(self.layer_new)
        pnl.pack(self.layer_to_bottom)
        pnl.pack(self.layer_lower)
        pnl.pack(self.layer_raise)
        pnl.pack(self.layer_to_top)
        pnl.pack(self.layer_delete)
        pnl.pack(self.layer_edit)
        self.panel.pack(pnl)

        bmp = [make_artid(item) for item in BITMAPS]
        pnl = wal.VPanel(self.panel, border=True)
        self.viewer = wal.LayerList(pnl,
                                    self.get_data(),
                                    bmp,
                                    on_select=self.update,
                                    on_change=self.changed,
                                    on_double_click=self.rename_layer)
        pnl.pack(self.viewer, fill=True, expand=True)
        self.panel.pack(pnl, padding_all=3, fill=True, expand=True)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)
        events.connect(events.PAGE_CHANGED, self.update)
        self.update()
Esempio n. 9
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)
        panel = wal.VPanel(self.panel)

        panel.pack(wal.Label(panel, _('Text position on circle')),
                   padding_all=5)

        self.bmp = PositionSwitch(panel)
        panel.pack(self.bmp, padding_all=5)

        self.other_side = wal.Checkbox(panel, _('Place on other side'),
                                       onclick=self.update_bmp)
        panel.pack(self.other_side, padding=5)

        self.apply_btn = wal.Button(panel, _('Apply'), onclick=self.action)
        panel.pack(self.apply_btn, padding=5, fill=True)

        self.panel.pack(panel, fill=True, padding_all=5)
        self.panel.pack(wal.HLine(self.panel), fill=True)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.SELECTION_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)

        self.update()
Esempio n. 10
0
    def __init__(self, app, master):
        wal.HidableHBox.__init__(self, master)
        self.master = master
        self.app = app
        self.actions = self.app.actions

        vbox = wal.VBox(self)
        self.pack(vbox)
        vbox.pack(wal.VBox(vbox), padding=15)

        entries = [
            None,
            modes.SELECT_MODE,
            modes.SHAPER_MODE,
            modes.ZOOM_MODE,
            modes.FLEUR_MODE,
            modes.LINE_MODE,
            modes.CURVE_MODE,
            modes.RECT_MODE,
            modes.ELLIPSE_MODE,
            #			modes.POLYGON_MODE ,
            modes.TEXT_MODE,
            None,
            rc.IMG_TOOL_STROKE,
            rc.IMG_TOOL_FILL,
            None
        ]

        for entry in entries:
            if entry is None:
                vbox.pack(wal.HLine(vbox))
            elif isinstance(entry, basestring):
                vbox.pack(wal.ImgButton(vbox, entry, flat=True))
            else:
                vbox.pack(wal.ActionToggleButton(vbox, self.actions[entry]))
Esempio n. 11
0
 def __init__(self):
     wal.MainWindow.__init__(self)
     self.set_size(300, 200)
     self.pack(wal.HLine(self), padding=30)
     hbox = wal.HBox(self)
     hbox.pack(wal.VLine(self), True, True)
     self.pack(hbox, True, True)
Esempio n. 12
0
 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)
Esempio n. 13
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)

        self.config = IconizerConfig()
        config_dir = self.app.appdata.app_config_dir
        config_file = os.path.join(config_dir, 'iconizer_config.xml')
        self.config.load(config_file)

        self.panel.pack((5, 5))
        hpanel = wal.HPanel(self.panel)
        hpanel.pack(wal.Label(hpanel, _('Background:')))
        self.bg_color_btn = wal.ColorButton(hpanel,
                                            self.config.bg_color,
                                            onchange=self.update,
                                            silent=False)
        hpanel.pack((5, 5))
        hpanel.pack(self.bg_color_btn)
        self.panel.pack(hpanel, padding=5)

        self.pallete = CBMiniPalette(self.panel,
                                     COLORS,
                                     onclick=self.bg_color_btn.set_value)
        self.panel.pack(self.pallete)

        self.panel.pack((10, 10))

        self.viewer = ImageViewer(self.panel, self.config.bg_color)
        self.panel.pack(self.viewer)

        self.panel.pack((10, 10))

        check_panel = wal.VPanel(self.panel)

        self.border_check = wal.Checkbox(check_panel,
                                         _('Show image border'),
                                         value=self.config.draw_border,
                                         onclick=self.update)
        check_panel.pack(self.border_check, align_center=False)

        self.sel_check = wal.Checkbox(check_panel,
                                      _('Draw selected only'),
                                      value=self.config.draw_selected,
                                      onclick=self.update)
        check_panel.pack(self.sel_check, align_center=False)

        self.panel.pack(check_panel)

        self.apply_btn = wal.Button(self.panel,
                                    _('Save image'),
                                    onclick=self.apply_action)
        self.panel.pack(self.apply_btn, fill=True, padding_all=5)

        self.panel.pack((5, 5))

        self.panel.pack(wal.HLine(self.panel), fill=True)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.SELECTION_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)
Esempio n. 14
0
    def build(self):
        prnpanel = wal.VPanel(self)
        # --- Control panels

        prnpanel.pack(PrinterPanel(prnpanel, self, self.printsys), fill=True)
        prnpanel.pack(PrintModePanel(prnpanel, self.printer), fill=True)
        prnpanel.pack(PageRangePanel(prnpanel, self.printout), fill=True)
        prnpanel.pack(CopiesPanel(prnpanel, self.printer, self.printout),
                      fill=True)

        # --- Control panels end

        self.pack(prnpanel, fill=True)
        self.pack(wal.VLine(self), fill=True)

        cont = wal.VPanel(self)

        r_grid = wal.GridPanel(cont)
        cv_grid = wal.GridPanel(r_grid)
        self.canvas = PreviewCanvas(cv_grid, self, self.printer, self.printout)

        units = self.printout.get_units()
        corner = PreviewCorner(r_grid)
        hruler = PreviewRuler(r_grid, self.canvas, units)
        hruler.set_bg(wal.WHITE)
        vruler = PreviewRuler(r_grid, self.canvas, units, False)
        vruler.set_bg(wal.WHITE)

        tb = PreviewToolbar(cont, self, self.canvas, self.printer)
        vscroll = wal.ScrollBar(cv_grid, onscroll=self.canvas._scrolling)
        hscroll = wal.ScrollBar(cv_grid,
                                False,
                                onscroll=self.canvas._scrolling)
        self.canvas.set_ctrls(hscroll, vscroll, hruler, vruler, tb.pager)

        cont.pack(tb, fill=True)
        cont.pack(wal.HLine(self), fill=True)

        cv_grid.add_growable_col(0)
        cv_grid.add_growable_row(0)
        cv_grid.pack(self.canvas, fill=True)
        cv_grid.pack(vscroll, fill=True)
        cv_grid.pack(hscroll, fill=True)
        cv_grid.pack((1, 1))

        r_grid.add_growable_col(1)
        r_grid.add_growable_row(1)
        r_grid.pack(corner)
        r_grid.pack(hruler, fill=True)
        r_grid.pack(vruler, fill=True)
        r_grid.pack(cv_grid, fill=True)

        cont.pack(r_grid, fill=True, expand=True)

        self.pack(cont, fill=True, expand=True)
        prn_events.connect(prn_events.PRINTER_CHANGED, self.printer_changed)
        prn_events.connect(prn_events.PRINTOUT_MODIFIED,
                           self.printout_modified)
        prn_events.connect(prn_events.PRINTER_MODIFIED, self.printer_modified)
Esempio n. 15
0
    def build(self):
        txt = _('Create new document on start')
        self.newdoc = wal.Checkbox(self, txt, config.new_doc_on_start)
        self.pack(self.newdoc, align_center=False, start_padding=5)

        txt = _('Make backup on document save')
        self.backup = wal.Checkbox(self, txt, config.make_backup)
        self.pack(self.backup, align_center=False)

        txt = _('Make backup on export')
        self.expbackup = wal.Checkbox(self, txt, config.make_export_backup)
        self.pack(self.expbackup, align_center=False)

        grid = wal.GridPanel(self, rows=2, cols=3, hgap=5, vgap=3)
        grid.pack(wal.Label(grid, _('History log size:')))
        self.hist_size = wal.IntSpin(grid,
                                     config.history_size, (10, 1000),
                                     spin_overlay=config.spin_overlay)
        grid.pack(self.hist_size)
        grid.pack(wal.Label(grid, _('records')))
        grid.pack(wal.Label(grid, _('History menu size:')))
        self.hist_menu_size = wal.IntSpin(grid,
                                          config.history_list_size, (5, 20),
                                          spin_overlay=config.spin_overlay)
        grid.pack(self.hist_menu_size)
        grid.pack(wal.Label(grid, _('records')))
        self.pack(grid, align_center=False, padding=5)

        txt = _('Show quick access buttons')
        self.stub_buttons = wal.Checkbox(self, txt, config.show_stub_buttons)
        self.pack(self.stub_buttons, align_center=False)

        if not config.is_mac():
            txt = _('Use overlay for spinbox widgets (*)')
            self.spin_overlay = wal.Checkbox(self, txt, config.spin_overlay)
            self.pack(self.spin_overlay, align_center=False)

        if config.is_ubuntu():
            txt = _('Ubuntu related features')
            self.pack(wal.Label(grid, txt, fontsize=2, fontbold=True),
                      start_padding=10)
            self.pack(wal.HLine(self), fill=True, padding=2)

            txt = _('Use Unity Global Menu (*)')
            self.ubuntu_gm = wal.Checkbox(self, txt, config.ubuntu_global_menu)
            self.pack(self.ubuntu_gm, align_center=False)

            txt = _('Allow overlay for scrollbars (*)')
            self.ubuntu_overlay = wal.Checkbox(self, txt,
                                               config.ubuntu_scrollbar_overlay)
            self.pack(self.ubuntu_overlay, align_center=False)

        if not config.is_mac():
            self.pack(wal.HPanel(self), expand=True, fill=True)
            txt = _('(*) - These options require application restart')
            self.pack(wal.Label(grid, txt, fontsize=-1), align_center=False)

        self.built = True
Esempio n. 16
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)
        panel = wal.VPanel(self.panel)
        self.transform_keeper = wal.HToggleKeeper(panel, TRANSFORM_MODES,
                                                  TRANSFORM_MODE_ICONS,
                                                  TRANSFORM_MODE_NAMES,
                                                  self.on_mode_change)
        panel.pack(self.transform_keeper)
        panel.pack(wal.HLine(panel), fill=True, padding=3)

        self.transform_panel = wal.VPanel(panel)

        self.transforms = {}
        for item in TRANSFORM_MODES:
            transf = TRANSFORM_CLASSES[item](self.transform_panel, self.app,
                                             self.on_reset)
            transf.hide()
            self.transforms[item] = transf

        panel.pack(self.transform_panel, fill=True)

        hpanel = wal.HPanel(panel)
        self.oi = OrientationIndicator(hpanel, onchange=self.on_orient_change)
        hpanel.pack(self.oi)
        hpanel.pack((10, 10))
        hpanel.pack(OriginIndicator(hpanel, self.app))

        panel.pack(hpanel, padding_all=10)

        self.apply_copy_btn = wal.Button(panel,
                                         _('Apply to copy'),
                                         onclick=self.action_copy)
        panel.pack(self.apply_copy_btn, fill=True)

        self.apply_btn = wal.Button(panel, _('Apply'), onclick=self.action)
        panel.pack(self.apply_btn, padding=3, fill=True)

        panel.pack(wal.HLine(panel), fill=True)

        self.panel.pack(panel, fill=True, expand=True, padding_all=5)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.SELECTION_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)
        self.update()
Esempio n. 17
0
	def __init__(self, app, dlg, fmt_config=None):
		wal.VPanel.__init__(self, dlg)
		self.fmt_config = fmt_config
		self.app = app
		self.dlg = dlg
		if self.icon_id:self.icon = get_icon(self.icon_id)
		if not self.title: self.title = self.name
		self.pack(wal.Label(self, self.title, fontsize=3, fontbold=True))
		self.pack(wal.HLine(self), fill=True, padding=5)
Esempio n. 18
0
    def build_ui(self):
        self.icon = get_icon(PLUGIN_ICON)
        panel = wal.VPanel(self.panel)

        panel.pack(wal.Label(panel, _('Text position on path')), padding_all=5)

        hp = wal.HPanel(panel)
        hp.pack(wal.Label(hp, _('Base point:')))
        self.base_point = wal.FloatSpin(hp,
                                        value=50.0,
                                        range_val=(0.0, 100.0),
                                        step=1.0)
        hp.pack(self.base_point, padding=5)
        hp.pack(wal.Label(hp, _('%')))

        panel.pack(hp, padding=5)

        self.align_keeper = wal.HToggleKeeper(panel,
                                              TEXT_ALIGNS,
                                              TEXT_ALIGN_ICONS,
                                              TEXT_ALIGN_TEXTS,
                                              on_change=self.update_bmp)
        panel.pack(self.align_keeper)
        self.align_keeper.set_mode(TEXT_ALIGNS[1])

        border = wal.VPanel(panel)
        color = wal.GRAY
        if wal.is_gtk(): color = wal.UI_COLORS['pressed_border']
        border.set_bg(color)
        self.pic_panel = wal.VPanel(border)
        self.pic_panel.set_bg(wal.WHITE)
        self.bmp = get_bmp(self.pic_panel, TEXT_ALIGN_PICS[TEXT_ALIGNS[1]])
        self.pic_panel.pack(self.bmp, padding_all=5)
        border.pack(self.pic_panel, padding_all=1)
        panel.pack(border, padding=10)

        self.other_side = wal.Checkbox(panel,
                                       _('Place on other side'),
                                       onclick=self.update_bmp)
        panel.pack(self.other_side, padding=5)

        self.apply_btn = wal.Button(panel, _('Apply'), onclick=self.action)
        panel.pack(self.apply_btn, padding=5, fill=True)

        self.panel.pack(panel, fill=True, padding_all=5)
        self.panel.pack(wal.HLine(self.panel), fill=True)

        events.connect(events.DOC_CHANGED, self.update)
        events.connect(events.SELECTION_CHANGED, self.update)
        events.connect(events.DOC_MODIFIED, self.update)

        self.update()
Esempio n. 19
0
    def __init__(self, master, app):
        self.app = app
        wal.HidableVBox.__init__(self, master)

        self.pack(wal.HLine(self), padding=1)

        box = wal.HBox(self)

        box.pack(
            wal.ImgButton(self,
                          rc.IMG_PALETTE_DOUBLE_ARROW_LEFT,
                          cmd=self.action_dback,
                          repeat=True,
                          flat=True))

        box.pack(
            wal.ImgButton(self,
                          rc.IMG_PALETTE_ARROW_LEFT,
                          cmd=self.action_back,
                          repeat=True,
                          flat=True))

        box.pack(
            wal.ClickableImage(self,
                               rc.IMG_PALETTE_NO_COLOR,
                               tooltip=_('Empthy pattern'),
                               cmd=self.action_nocolor))

        self.pw = HPaletteWidget(box, self.app)
        box.pack(self.pw, True, True, 1)

        box.pack(
            wal.ImgButton(self,
                          rc.IMG_PALETTE_ARROW_RIGHT,
                          cmd=self.action_forward,
                          repeat=True,
                          flat=True))

        box.pack(
            wal.ImgButton(self,
                          rc.IMG_PALETTE_DOUBLE_ARROW_RIGHT,
                          cmd=self.action_dforward,
                          repeat=True,
                          flat=True))
        self.pack(box, True, True)

        if config.palette_orientation == const.HORIZONTAL and config.palette_visible:
            self.set_visible(True)
        else:
            self.set_visible(False)
Esempio n. 20
0
    def __init__(self, parent, label='CAPTION'):
        self.title = label.upper()
        wal.VPanel.__init__(self, parent)
        hpanel = wal.HPanel(self)
        hpanel.pack(SPACER)
        self.cont = wal.VPanel(hpanel)
        self.cont.pack(wal.Label(self.cont, self.title, fontsize=3),
                       padding=5, align_center=False)

        self.build()

        hpanel.pack(self.cont, fill=True, expand=True)
        hpanel.pack(SPACER)
        self.pack(hpanel, fill=True)

        self.pack(SPACER)
        self.pack(wal.HLine(self), fill=True)
Esempio n. 21
0
	def __init__(self, app, parent):
		self.app = app
		self.buttons = []
		wal.VPanel.__init__(self, parent)
		self.pack((5, 5))
		for item in BUTTONS:
			if item is None: self.pack(wal.HLine(self.panel), fill=True)
			else:
				action = self.app.actions[item]
				if action.is_toggle():
					but = ActionTool(self.panel, action)
				else:
					but = ActionToolButton(self.panel, action)
				self.buttons.append(but)
				self.pack(but, padding=1)
		self.pack((15, 15))
		self.pack(StyleMonitor(self, self.app))
Esempio n. 22
0
	def build(self):

		self.mixer = RGB_Mixer(self, self.cms, onchange=self.update)
		self.pack(self.mixer)

		self.pack(wal.HLine(self), fill=True, padding=5)

		bot_panel = wal.HPanel(self)
		self.refpanel = FillColorRefPanel(bot_panel, self.cms, [], [],
										on_orig=self.set_orig_fill)
		bot_panel.pack(self.refpanel)
		bot_panel.pack(wal.HPanel(bot_panel), fill=True, expand=True)

		minipal = MiniPalette(bot_panel, self.cms, RGB_PALETTE,
							self.on_palette_click)
		bot_panel.pack(minipal, padding_all=5)

		self.pack(bot_panel, fill=True)
Esempio n. 23
0
	def __init__(self, parent, val=(0.0, 0.0), onchange=None):
		self.val = val
		self.callback = onchange
		self.toggles = {-1.0:{}, 0.0:{}, 1.0:{}}
		wal.GridPanel.__init__(self, parent, 5, 5, 2, 2)
		for y in REV_VALS:
			for x in VALS:
				state = False
				if (x, y) == (0.0, 0.0): state = True
				toggle = OIToggle(self, (x, y), state, self.on_change)
				self.pack(toggle)
				self.toggles[x][y] = toggle
				if x < 1.0: self.pack(wal.HLine(self), fill=True)
			if y > -1.0:
				self.pack(wal.VLine(self), fill=True)
				self.pack(CELL_SIZE)
				self.pack(wal.VLine(self), fill=True)
				self.pack(CELL_SIZE)
				self.pack(wal.VLine(self), fill=True)
Esempio n. 24
0
 def __init__(self, parent, val=(0.0, 0.0), onchange=None):
     self.val = val
     self.callback = onchange
     self.toggles = {-1.0: {}, 0.0: {}, 1.0: {}}
     wal.GridPanel.__init__(self, parent, 5, 5, 2, 2)
     for y in REV_VALS:
         for x in VALS:
             state = (x, y) == (0.0, 0.0)
             toggle = OIToggle(self, (x, y), state, self.on_change)
             self.pack(toggle)
             self.toggles[x][y] = toggle
             if x < 1.0:
                 panel = wal.HPanel(self)
                 panel.pack(wal.HLine(self), expand=True)
                 self.pack(panel, fill=True)
         if y > -1.0:
             for i in range(3):
                 panel = wal.VPanel(self)
                 panel.pack(wal.VLine(panel), expand=True)
                 self.pack(panel, fill=True)
                 self.pack(CELL_SIZE) if i < 2 else None
Esempio n. 25
0
    def build(self):
        self.page_format = self.doc.methods.get_default_page_format()
        self.formats = [
            _('Custom'),
        ] + uc2const.PAGE_FORMAT_NAMES
        self.pack((5, 10))

        # ---
        hpanel = wal.HPanel(self)
        hpanel.pack((5, 5))
        label = wal.Label(hpanel, _('Default page:'))
        hpanel.pack(label)
        hpanel.pack((5, 5))
        self.page_combo = wal.Combolist(self,
                                        items=self.formats,
                                        onchange=self.page_combo_changed)
        index = 0
        state = True
        if self.page_format[0] in uc2const.PAGE_FORMAT_NAMES:
            index = self.formats.index(self.page_format[0])
            state = False
        self.page_combo.set_active(index)

        hpanel.pack(self.page_combo)

        hpanel.pack((15, 5))

        self.orient_keeper = wal.HToggleKeeper(self,
                                               ORIENTS,
                                               ORIENTS_ICONS,
                                               ORIENTS_NAMES,
                                               on_change=self.orient_changed)
        self.orient_keeper.set_mode(self.page_format[2])
        hpanel.pack(self.orient_keeper)

        self.pack(hpanel, fill=True)

        self.pack((5, 5))

        # ---
        w, h = self.page_format[1]
        hpanel = wal.HPanel(self)
        dx = label.get_size()[0] + 10
        hpanel.pack((dx, 5))

        self.page_width = UnitSpin(self.app,
                                   hpanel,
                                   w,
                                   onchange=self.page_spin_changed)
        hpanel.pack(self.page_width)
        hpanel.pack(get_bmp(self, icons.CTX_W_ON_H), padding=5)
        self.page_height = UnitSpin(self.app,
                                    hpanel,
                                    h,
                                    onchange=self.page_spin_changed)
        hpanel.pack(self.page_height)
        hpanel.pack(StaticUnitLabel(self.app, hpanel), padding=5)
        self.page_width.set_enable(state)
        self.page_height.set_enable(state)

        self.pack(hpanel, fill=True)
        self.pack(wal.HLine(self), padding_all=5, fill=True)

        # ---
        hpanel = wal.HPanel(self)
        hpanel.pack((5, 5))
        self.desktop_bg = self.doc.methods.get_desktop_bg()

        grid = wal.GridPanel(hpanel, 3, 3, 5, 5)
        grid.add_growable_col(2)

        grid.pack(wal.Label(hpanel, _('Desktop:')))
        self.desktop_color_btn = wal.ColorButton(hpanel, self.desktop_bg)
        grid.pack(self.desktop_color_btn)
        grid.pack(CBMiniPalette(grid,
                                onclick=self.desktop_color_btn.set_value))

        self.page_fill = self.doc.methods.get_page_fill()
        if self.page_fill[0] == FILL_SOLID:
            color1 = self.page_fill[1]
            color2 = [1.0, 1.0, 1.0]
        else:
            color1 = self.page_fill[1][0]
            color2 = self.page_fill[1][1]

        grid.pack(wal.Label(hpanel, _('Page:')))
        self.page_color1_btn = wal.ColorButton(hpanel, color1)
        grid.pack(self.page_color1_btn)
        grid.pack(CBMiniPalette(grid, onclick=self.page_color1_btn.set_value))

        grid.pack((5, 5))
        self.page_color2_btn = wal.ColorButton(hpanel, color2)
        grid.pack(self.page_color2_btn)
        self.colors2 = CBMiniPalette(grid,
                                     onclick=self.page_color2_btn.set_value)
        grid.pack(self.colors2)
        if not self.page_fill[0] == FILL_PATTERN:
            self.page_color2_btn.set_enable(False)
            self.colors2.set_enable(False)

        hpanel.pack(grid, fill=True)
        hpanel.pack((5, 5))
        self.pack(hpanel, fill=True)

        # ---
        vpanel = wal.VPanel(self)
        if wal.IS_MSW: vpanel.pack((5, 5))

        self.pattern_check = wal.Checkbox(vpanel,
                                          _('Use pattern for page fill'),
                                          self.page_fill[0] == FILL_PATTERN,
                                          onclick=self.pattern_check_changed)
        vpanel.pack(self.pattern_check, align_center=False)

        if wal.IS_MSW: vpanel.pack((5, 5))

        self.border_flag = self.doc.methods.get_page_border()
        self.border_check = wal.Checkbox(vpanel, _('Show page border'),
                                         self.border_flag)
        vpanel.pack(self.border_check, align_center=False)
        self.pack(vpanel, fill=True, padding_all=5)
Esempio n. 26
0
    def __init__(self, app, parent):
        self.app = app
        self.mw = parent
        wal.VPanel.__init__(self, parent)

        self.ctxpanel = AppCtxPanel(self.app, self)
        self.doc_tabs = DocTabPanel(app, self,
                                    config.ui_style != appconst.GUI_CLASSIC)

        if config.ui_style == appconst.GUI_CLASSIC:
            if not wal.IS_MAC:
                self.pack(wal.HLine(self), fill=True)
            self.pack(self.ctxpanel, fill=True)
            self.pack(self.doc_tabs, fill=True)

        if config.ui_style == appconst.GUI_TABBED:
            self.pack(self.doc_tabs, fill=True)
            self.pack(self.ctxpanel, fill=True)
            self.pack(wal.PLine(self), fill=True)

        # ===== Main part
        hpanel = wal.HPanel(self)
        self.pack(hpanel, expand=True, fill=True)

        # ----- Tools
        self.tools = AppTools(self.app, hpanel)
        hpanel.pack(self.tools, fill=True, padding_all=2)
        hpanel.pack(wal.PLine(hpanel), fill=True)

        self.splitter = wal.Splitter(hpanel, hidden=True)

        # ----- Doc Area
        self.grid_panel = wal.GridPanel(self.splitter)
        self.grid_panel.add_growable_col(1)
        self.grid_panel.add_growable_row(1)
        self.corner = RulerSurface(self.app, self.grid_panel)
        self.grid_panel.add(self.corner)
        self.hruler = HRulerSurface(self.app, self.grid_panel)
        self.grid_panel.pack(self.hruler, fill=True)
        self.vruler = VRulerSurface(self.app, self.grid_panel)
        self.grid_panel.pack(self.vruler, fill=True)

        int_grid = wal.GridPanel(self.grid_panel)
        int_grid.add_growable_col(0)
        int_grid.add_growable_row(0)
        self.canvas = CanvasSurface(self.app, int_grid)
        int_grid.pack(self.canvas, fill=True)
        self.vscroll = wal.ScrollBar(int_grid)
        int_grid.pack(self.vscroll, fill=True)
        self.hscroll = wal.ScrollBar(int_grid, vertical=False)
        int_grid.pack(self.hscroll, fill=True)
        self.viewer = wal.VPanel(int_grid)
        int_grid.pack(self.viewer, fill=True)

        self.canvas.set_scrolls(self.hscroll, self.vscroll)
        self.grid_panel.pack(int_grid, fill=True)

        # ----- Doc Area End
        self.plg_area = PlgArea(self.app, self.splitter)
        self.app.mdiarea = self
        self.app.plg_area = self.plg_area

        self.splitter.split_vertically(self.grid_panel, self.plg_area)
        self.splitter.set_min_size(200)
        self.splitter.set_sash_gravity(1.0)
        self.splitter.unsplit()
        hpanel.pack(self.splitter, expand=True, fill=True)

        # ----- Vertical Palette panel
        self.vp_panel = wal.HPanel(hpanel)
        self.vp_panel.pack(wal.PLine(self.vp_panel), fill=True)
        vpalette_panel = AppVPalette(self.vp_panel, self.app)
        self.vp_panel.pack(vpalette_panel, fill=True, padding=2)
        hpanel.pack(self.vp_panel, fill=True)
        if config.palette_orientation == uc2const.HORIZONTAL:
            self.vp_panel.hide()

        # ----- Horizontal Palette panel
        self.hp_panel = wal.VPanel(self)
        self.hp_panel.pack(wal.PLine(self.hp_panel), fill=True)
        hpalette_panel = AppHPalette(self.hp_panel, self.app)
        self.hp_panel.pack(hpalette_panel, fill=True, padding=2)
        self.pack(self.hp_panel, fill=True)

        self.change_palette()

        # ----- Status bar
        self.pack(wal.PLine(self), fill=True)
        self.statusbar = AppStatusbar(self)
        self.pack(self.statusbar, fill=True)

        self.layout()
        events.connect(events.CONFIG_MODIFIED, self.config_update)
Esempio n. 27
0
    def build(self):
        vpanel = wal.VPanel(self)
        grid = wal.GridPanel(vpanel, rows=4, cols=2, hgap=25, vgap=7)

        txt = _('Language (*):')
        grid.pack(wal.Label(grid, txt))
        self.lang = wal.Combolist(grid, items=LANGS)
        index = 0 if config.language == 'system' \
            else LANGS.index(config.language)
        self.lang.set_active(index)
        grid.pack(self.lang, fill=True)

        txt = _('UI style (*):')
        grid.pack(wal.Label(grid, txt))
        items = [_('Classic'), _('Tabbed')]
        self.ui_style = wal.Combolist(grid, items=items)
        self.ui_style.set_active(config.ui_style)
        grid.pack(self.ui_style, fill=True)

        txt = _('Tab style:')
        grid.pack(wal.Label(grid, txt))
        items = [
            _('Rectangular tabs'),
            _('Rounded tabs'),
            _('Flat tabs'),
            _('Trapezoidal tabs')
        ]
        self.tab_style = wal.Combolist(grid, items=items)
        index = config.tab_style if config.tab_style < len(items) else 0
        self.tab_style.set_active(index)
        grid.pack(self.tab_style, fill=True)

        txt = _('Show quick access buttons')
        grid.pack(wal.Label(grid, txt))
        self.stub_buttons = wal.Switch(grid, config.show_stub_buttons)
        grid.pack(self.stub_buttons)

        vpanel.pack(grid, align_center=False, padding_all=10)

        # ---------------------------------

        int_vp = wal.VPanel(vpanel)
        vpanel.pack(int_vp, fill=True, padding_all=5)

        if not wal.IS_MAC and wal.IS_WX2:
            txt = _('Use overlay for spinbox widgets (*)')
            self.spin_overlay = wal.Checkbox(int_vp, txt, config.spin_overlay)
            int_vp.pack(self.spin_overlay, align_center=False)

        if wal.IS_GTK and wal.IS_WX2:
            txt = _('Separate spin in spinbox widgets (*)')
            self.spin_sep = wal.Checkbox(int_vp, txt, config.spin_sep)
            int_vp.pack(self.spin_sep, align_center=False)

        if wal.IS_UNITY:
            txt = _('Unity related features')
            int_vp.pack(wal.Label(int_vp, txt, fontsize=2, fontbold=True),
                        start_padding=10)
            int_vp.pack(wal.HLine(int_vp), fill=True, padding=2)

            txt = _('Use Unity Global Menu (*)')
            self.ubuntu_gm = wal.Checkbox(int_vp, txt,
                                          config.ubuntu_global_menu)
            int_vp.pack(self.ubuntu_gm, align_center=False)

            txt = _('Allow overlay for scrollbars (*)')
            self.ubuntu_overlay = wal.Checkbox(int_vp, txt,
                                               config.ubuntu_scrollbar_overlay)
            int_vp.pack(self.ubuntu_overlay, align_center=False)

        self.pack(vpanel)
        self.pack((1, 1), expand=True)

        txt = _('(*) - Application restart is required to apply these options')
        self.pack(wal.Label(self, txt, fontsize=-1))

        self.built = True
Esempio n. 28
0
    def __init__(self):
        wal.MainWindow.__init__(self, vertical=False)
        self.set_size(SIZE)

        self.pack(wal.HLine(self), expand=True, fill=True)
Esempio n. 29
0
    def __init__(self, parent, prefpanel):
        CMS_Tab.__init__(self, parent, prefpanel)

        txt = _('Colorspace profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, rows=10, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        self.cs_widgets = {}
        self.cs_profiles = {}
        self.cs_config_profiles = {}

        self.cs_config = {
            COLOR_RGB: config.cms_rgb_profile,
            COLOR_CMYK: config.cms_cmyk_profile,
            COLOR_LAB: config.cms_lab_profile,
            COLOR_GRAY: config.cms_gray_profile,
            COLOR_DISPLAY: config.cms_display_profile
        }

        for colorspace in COLORSPACES[:-1]:
            txt = _('%s profile:') % colorspace
            grid.pack(wal.Label(grid, txt))
            combo = wal.Combolist(grid, items=[])
            self.cs_widgets[colorspace] = combo
            grid.pack(combo, fill=True)
            self.update_combo(colorspace)
            grid.pack(ManageButton(grid, self, colorspace))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Hardware profiles')
        self.pack(wal.Label(self, txt, fontbold=True), padding=2)
        self.pack(wal.HLine(self), fill=True, padding_all=2)

        grid = wal.GridPanel(self, cols=3, hgap=5, vgap=5)
        grid.add_growable_col(1)

        txt = _('Display profile:')
        grid.pack(wal.Label(grid, txt))
        combo = wal.Combolist(grid, items=[])
        self.cs_widgets[COLOR_DISPLAY] = combo
        grid.pack(combo, fill=True)
        self.update_combo(COLOR_DISPLAY)
        grid.pack(ManageButton(grid, self, COLOR_DISPLAY))

        self.pack(grid, fill=True, padding_all=5)

        txt = _('Use display profile')
        self.display_check = wal.Checkbox(self,
                                          txt,
                                          config.cms_use_display_profile,
                                          onclick=self.activate_display)
        self.pack(self.display_check, align_center=False)

        txt = _('Note: Display profile affects on '
                'document screen representation only. The profile for your '
                'hardware you can get either from monitor manufacture or '
                'calibrating monitor (preferred option) or download '
                'from ICC Profile Taxi service: ')
        fontsize = -3
        if wal.is_msw(): fontsize = -1
        label = wal.Label(self, txt, fontsize=fontsize)
        label.set_enable(False)
        if wal.is_msw(): label.wrap(430)
        self.pack(label, fill=True, padding_all=5)
        self.pack(wal.HtmlLabel(self, 'http://icc.opensuse.org/'))
        self.activate_display()
Esempio n. 30
0
    def __init__(self, app, parent):
        self.app = app
        self.mw = parent
        self.docareas = []
        wal.VPanel.__init__(self, parent)

        if not wal.IS_MAC:
            self.pack(wal.HLine(self), fill=True)

        # ----- Context panel
        self.ctxpanel = AppCtxPanel(self.app, self)
        self.pack(self.ctxpanel, fill=True, padding=1)

        # ----- Doc tabs
        self.dtp = DocTabsPanel(self)
        self.doc_tabs = self.dtp.doc_tabs
        self.pack(self.dtp, fill=True)

        hpanel = wal.HPanel(self)
        self.pack(hpanel, expand=True, fill=True)

        # ----- Tools
        self.tools = AppTools(self.app, hpanel)
        hpanel.pack(self.tools, fill=True, padding_all=2)
        hpanel.pack(wal.PLine(hpanel), fill=True)

        self.splitter = wal.Splitter(hpanel)
        self.doc_keeper = wal.VPanel(self.splitter)
        self.doc_keeper.SetBackgroundColour(wal.WHITE)
        self.plg_area = PlgArea(self.app, self.splitter)
        self.app.mdiarea = self
        self.app.plg_area = self.plg_area

        self.splitter.split_vertically(self.doc_keeper, self.plg_area)
        self.splitter.set_min_size(200)
        self.splitter.set_sash_gravity(1.0)
        self.splitter.unsplit()
        hpanel.pack(self.splitter, expand=True, fill=True)

        # ----- Vertical Palette panel
        self.vp_panel = wal.HPanel(hpanel)
        self.vp_panel.pack(wal.PLine(self.vp_panel), fill=True)
        vpalette_panel = AppVPalette(self.vp_panel, self.app)
        self.vp_panel.pack(vpalette_panel, fill=True, padding=2)
        hpanel.pack(self.vp_panel, fill=True, start_padding=2)
        if config.palette_orientation == uc2const.HORIZONTAL:
            self.vp_panel.hide()

        # ----- Horizontal Palette panel
        self.hp_panel = wal.VPanel(self)
        self.hp_panel.pack(wal.PLine(self.hp_panel), fill=True)
        hpalette_panel = AppHPalette(self.hp_panel, self.app)
        self.hp_panel.pack(hpalette_panel, fill=True, padding=2)
        self.pack(self.hp_panel, fill=True)

        self.change_palette()

        # ----- Status bar
        self.pack(wal.PLine(self), fill=True)
        self.statusbar = AppStatusbar(self)
        self.pack(self.statusbar, fill=True, padding=2)

        self.layout()
        events.connect(events.CONFIG_MODIFIED, self.config_update)