Skip to content

Commit

Permalink
Rewrite the UI for color application mode
Browse files Browse the repository at this point in the history
now buttons are generated in python, and they're displayed when active (instead of staying hidden)

this is part of #329
  • Loading branch information
maoschanz committed Feb 13, 2021
1 parent 03b1556 commit 9c072db
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 235 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ incorrect english labels, please report an issue about it.

### Tools

(last update: **version 0.6.4**)
(last update: **version 0.6.5**)

*Tools in italic can be disabled.*

Expand Down
8 changes: 0 additions & 8 deletions data/com.github.maoschanz.drawing.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@
Version 0.6.5 features several minor bug fixes, and various new
translations.
</p>
<p>
Among the funny bugs: the bottom panes sometimes refused to adapt to
the screen size, and could disappear under certain conditions.
</p>
<p>
The catastrophic "print" action, that no one ever used so no one ever
noticed, is now somewhat usable.
</p>
</description>
</release>
</releases>
Expand Down
3 changes: 2 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ drawing (0.8.0) unstable; urgency=low
* add an "increase constrast" filter (#308)
* remove the cool but deprecated GNOME Shell app menu
* deleting the selection can now leave something else than transparency #232
* exclude the color left under the selection from the selection itself #232
* option to exclude the color left under the selection from the selection itself #232
* rewrite the UI to change the color application mode (#329)
* update several translations

-- Romain F. T. <rrroschan@gmail.com> Sat, 20 Feb 2021 13:12:00 +0100
Expand Down
5 changes: 3 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ <h2><a id="tools"></a>Tools</h2><!-- ********************************* -->
<li>Color picker*</li>
<li>Paint*</li>
</ul>

<p>*these tools are disabled by default.</p>
</div>

<div class="col50">
Expand All @@ -221,8 +223,7 @@ <h2><a id="tools"></a>Tools</h2><!-- ********************************* -->
</li>
</ul>

<p>(last update of this list: version 0.6.4)</p>
<p>*these tools are disabled by default.</p>
<p>(last update of this list: version 0.6.5)</p>
</div>

</div>
Expand Down
1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ src/optionsbars/transform/optionsbar_scale.py
src/optionsbars/transform/optionsbar_skew.py

src/optionsbars/classic/optionsbar-classic.ui
src/optionsbars/classic/optionsbar-color-menus.ui
src/optionsbars/classic/optionsbar-color-popover.ui
src/optionsbars/selection/optionsbar-selection.ui
src/optionsbars/transform/optionsbar-crop.ui
Expand Down
1 change: 1 addition & 0 deletions src/drawing.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

<file>optionsbars/classic/optionsbar-classic.ui</file>
<file>optionsbars/classic/optionsbar-color-popover.ui</file>
<file>optionsbars/classic/optionsbar-operator-menus.ui</file>
<file>optionsbars/selection/optionsbar-selection.ui</file>
<file>optionsbars/transform/optionsbar-crop.ui</file>
<file>optionsbars/transform/optionsbar-filters.ui</file>
Expand Down
219 changes: 0 additions & 219 deletions src/optionsbars/classic/optionsbar-color-popover.ui
Original file line number Diff line number Diff line change
Expand Up @@ -34,153 +34,6 @@
</object>
</child>

<!-- -->

<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<style><class name="linked"/></style>

<child>
<object class="GtkRadioButton">
<property name="group">op-group</property>
<!-- <property name="visible">True</property> -->
<property name="draw-indicator">False</property>
<property name="action-name">win.cairo_op_mirror</property>
<property name="action-target">'multiply'</property>
</object>
</child>
<child>
<object class="GtkRadioButton">
<property name="group">op-group</property>
<!-- <property name="visible">True</property> -->
<property name="draw-indicator">False</property>
<property name="action-name">win.cairo_op_mirror</property>
<property name="action-target">'screen'</property>
</object>
</child>

<child>
<object class="GtkMenuButton" id="op-menubtn1">
<property name="visible">True</property>
<property name="menu-model">highlight-operators-menu</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">tool-highlight-symbolic</property>
</object>
</child>
</object>
</child>

</object>
</child>

<!-- -->

<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<style><class name="linked"/></style>

<child>
<object class="GtkRadioButton">
<property name="group">op-group</property>
<!-- <property name="visible">True</property> -->
<property name="draw-indicator">False</property>
<property name="action-name">win.cairo_op_mirror</property>
<property name="action-target">'hsl-hue'</property>
</object>
</child>
<child>
<object class="GtkRadioButton">
<property name="group">op-group</property>
<!-- <property name="visible">True</property> -->
<property name="draw-indicator">False</property>
<property name="action-name">win.cairo_op_mirror</property>
<property name="action-target">'hsl-saturation'</property>
</object>
</child>
<child>
<object class="GtkRadioButton">
<property name="group">op-group</property>
<!-- <property name="visible">True</property> -->
<property name="draw-indicator">False</property>
<property name="action-name">win.cairo_op_mirror</property>
<property name="action-target">'hsl-color'</property>
</object>
</child>
<child>
<object class="GtkRadioButton">
<property name="group">op-group</property>
<!-- <property name="visible">True</property> -->
<property name="draw-indicator">False</property>
<property name="action-name">win.cairo_op_mirror</property>
<property name="action-target">'hsl-luminosity'</property>
</object>
</child>

<child>
<object class="GtkMenuButton" id="op-menubtn2">
<property name="visible">True</property>
<property name="menu-model">hsl-operators-menu</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">display-brightness-symbolic</property>
</object>
</child>
</object>
</child>

</object>
</child>

<!-- -->

<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<style><class name="linked"/></style>

<child>
<object class="GtkRadioButton">
<property name="group">op-group</property>
<!-- <property name="visible">True</property> -->
<property name="draw-indicator">False</property>
<property name="action-name">win.cairo_op_mirror</property>
<property name="action-target">'source'</property>
</object>
</child>
<child>
<object class="GtkRadioButton">
<property name="group">op-group</property>
<!-- <property name="visible">True</property> -->
<property name="draw-indicator">False</property>
<property name="action-name">win.cairo_op_mirror</property>
<property name="action-target">'difference'</property>
</object>
</child>

<child>
<object class="GtkMenuButton" id="op-menubtn">
<property name="visible">True</property>
<property name="menu-model">other-operators-menu</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon-name">view-more-symbolic</property>
</object>
</child>
</object>
</child>

</object>
</child>

</object>
</child>

Expand Down Expand Up @@ -260,77 +113,5 @@
</child>
</object>

<!-- -->

<menu id="other-operators-menu">
<section>
<!-- Context: possible ways to apply the color to the canvas -->
<attribute name="label" translatable="yes">Other modes</attribute>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Raw source color</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">source</attribute>
</item>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Difference</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">difference</attribute>
</item>
<!-- and more...? -->
</section>
</menu>

<menu id="highlight-operators-menu">
<section>
<!-- Context: possible ways to apply the color to the canvas -->
<attribute name="label" translatable="yes">Highlight</attribute>
<item>
<!-- Context: a possible way to highlight text -->
<attribute name="label" translatable="yes">Dark text on light background</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">multiply</attribute>
</item>
<item>
<!-- Context: a possible way to highlight text -->
<attribute name="label" translatable="yes">Light text on dark background</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">screen</attribute>
</item>
</section>
</menu>

<menu id="hsl-operators-menu">
<section>
<!-- Context: possible ways to apply the color to the canvas -->
<attribute name="label" translatable="yes">Photo-oriented modes</attribute>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Hue only</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">hsl-hue</attribute>
</item>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Saturation only</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">hsl-saturation</attribute>
</item>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Hue and saturation</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">hsl-color</attribute>
</item>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Luminosity only</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">hsl-luminosity</attribute>
</item>
</section>
</menu>

</interface>

76 changes: 76 additions & 0 deletions src/optionsbars/classic/optionsbar-operator-menus.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="drawing">

<menu id="other-operators-menu">
<section>
<!-- Context: possible ways to apply the color to the canvas -->
<attribute name="label" translatable="yes">Other modes</attribute>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Raw source color</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">source</attribute>
</item>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Difference</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">difference</attribute>
</item>
<!-- and more...? -->
</section>
</menu>

<menu id="highlight-operators-menu">
<section>
<!-- Context: possible ways to apply the color to the canvas -->
<attribute name="label" translatable="yes">Highlight</attribute>
<item>
<!-- Context: a possible way to highlight text -->
<attribute name="label" translatable="yes">Dark text on light background</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">multiply</attribute>
</item>
<item>
<!-- Context: a possible way to highlight text -->
<attribute name="label" translatable="yes">Light text on dark background</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">screen</attribute>
</item>
</section>
</menu>

<menu id="hsl-operators-menu">
<section>
<!-- Context: possible ways to apply the color to the canvas, using -->
<!-- only some specific dimension(s) of the selected color in its -->
<!-- hue-saturation-luminosity (HSL) representation -->
<attribute name="label" translatable="yes">HSL modes</attribute>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Hue only</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">hsl-hue</attribute>
</item>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Saturation only</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">hsl-saturation</attribute>
</item>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Hue and saturation</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">hsl-color</attribute>
</item>
<item>
<!-- Context: a possible way to apply the color to the canvas -->
<attribute name="label" translatable="yes">Luminosity only</attribute>
<attribute name="action">win.cairo_operator</attribute>
<attribute name="target">hsl-luminosity</attribute>
</item>
</section>
</menu>

</interface>
Loading

0 comments on commit 9c072db

Please sign in to comment.