diff --git a/glade/icons/hicolor/16x16/actions/widget-mypaint-brushcolorindicator.png b/glade/icons/hicolor/16x16/actions/widget-mypaint-brushcolorindicator.png new file mode 100644 index 00000000..01c33613 Binary files /dev/null and b/glade/icons/hicolor/16x16/actions/widget-mypaint-brushcolorindicator.png differ diff --git a/glade/icons/hicolor/16x16/actions/widget-mypaint-drawwindow.png b/glade/icons/hicolor/16x16/actions/widget-mypaint-drawwindow.png new file mode 100644 index 00000000..6f781511 Binary files /dev/null and b/glade/icons/hicolor/16x16/actions/widget-mypaint-drawwindow.png differ diff --git a/glade/icons/hicolor/22x22/actions/widget-mypaint-brushcolorindicator.png b/glade/icons/hicolor/22x22/actions/widget-mypaint-brushcolorindicator.png new file mode 100644 index 00000000..6b53cf63 Binary files /dev/null and b/glade/icons/hicolor/22x22/actions/widget-mypaint-brushcolorindicator.png differ diff --git a/glade/icons/hicolor/22x22/actions/widget-mypaint-drawwindow.png b/glade/icons/hicolor/22x22/actions/widget-mypaint-drawwindow.png new file mode 100644 index 00000000..d33e6b0d Binary files /dev/null and b/glade/icons/hicolor/22x22/actions/widget-mypaint-drawwindow.png differ diff --git a/glade/icons/hicolor/scalable/actions/widget-mypaint-brushcolorpickerbutton.svg b/glade/icons/hicolor/scalable/actions/widget-mypaint-brushcolorpickerbutton.svg new file mode 100644 index 00000000..41c8ef15 --- /dev/null +++ b/glade/icons/hicolor/scalable/actions/widget-mypaint-brushcolorpickerbutton.svg @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/glade/mypaint_widgets.xml b/glade/mypaint_widgets.xml index 708a5fa6..42aa1f4b 100644 --- a/glade/mypaint_widgets.xml +++ b/glade/mypaint_widgets.xml @@ -257,8 +257,38 @@ optional-default="True"/> + + + + + + + + + + + + + + + + + + + + + + @@ -269,6 +299,8 @@ + + diff --git a/gui/colorpicker.py b/gui/colorpicker.py index 708bc0c4..98656551 100644 --- a/gui/colorpicker.py +++ b/gui/colorpicker.py @@ -232,3 +232,24 @@ def paint(self, cr): self._previous_area = area + +## More conventional color-picking button, with grab + + +class BrushColorPickerButton (colors.ColorPickerButton): + """Color picker button that sets the app's working brush color.""" + + __gtype_name__ = "MyPaintBrushColorPickerButton" + + def __init__(self): + colors.ColorPickerButton.__init__(self) + self.connect("realize", self._init_color_manager) + + def _init_color_manager(self, widget): + from application import get_app + app = get_app() + mgr = app.brush_color_manager + assert mgr is not None + self.set_color_manager(mgr) + + diff --git a/gui/colorpreview.py b/gui/colorpreview.py new file mode 100644 index 00000000..04b9ad52 --- /dev/null +++ b/gui/colorpreview.py @@ -0,0 +1,34 @@ +# This file is part of MyPaint. +# Copyright (C) 2013 by Andrew Chadwick +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or + + +"""Color preview widget / current color indicator, for the status bar.""" + +# TODO: This *might* evolve to a color preview + alpha selector, possibly +# TODO: with a history row taking up the bottom. For now let's draw it at +# TODO: an aspect ratio of about 1:5 and see how users like it. + + +from colors import PreviousCurrentColorAdjuster + + +class BrushColorIndicator (PreviousCurrentColorAdjuster): + """Previous/Current color adjuster bound to app.brush_color_manager""" + + __gtype_name__ = "MyPaintBrushColorIndicator" + + def __init__(self): + PreviousCurrentColorAdjuster.__init__(self) + self.connect("realize", self._init_color_manager) + + def _init_color_manager(self, widget): + from application import get_app + app = get_app() + mgr = app.brush_color_manager + assert mgr is not None + self.set_color_manager(mgr) +