Skip to content

Commit

Permalink
Mirror the color wheel innards
Browse files Browse the repository at this point in the history
To make the color wheel look like it does in most other software,
ascending least saturated to most saturated, instead of the other way
round. The descending variant can be toggled in the preferences.
  • Loading branch information
askmeaboutlo0m committed Aug 19, 2023
1 parent bdab25a commit 852ba83
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Unreleased Version 2.2.0-pre
* Feature: Make canvas rendering and preview painting asynchronous. This should make the UI much more responsive when e.g. changing layer visibility or transforming a large selection.
* Fix: Properly handle canvas resizes while transforming a selection, it now no longer causes the source of the transform to get offset.
* Fix: Show the current color properly on program startup.
* Feature: Make the color wheel innards go from least to most saturated, putting it in line with how most other software presents it. This can be toggled in the preferences.

2023-07-31 Version 2.2.0-beta.6
* Fix: Don't forget account password when entering a wrong session password.
Expand Down
9 changes: 9 additions & 0 deletions src/desktop/dialogs/settingsdialog/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ void Tools::initColorWheel(desktop::settings::Settings &settings, utils::SanerFo

form->addSpacer();

auto *mirror = form->addRadioGroup(tr("Direction:"), false, {
{ tr("Ascending"), true },
{ tr("Descending"), false }
});
settings.bindColorWheelMirror(mirror);

form->addSpacer();

auto *space = form->addRadioGroup(tr("Color space:"), false, {
{ tr("HSV (Hue–Saturation–Value)"),
color_widgets::ColorWheel::ColorSpaceEnum::ColorHSV },
Expand All @@ -130,6 +138,7 @@ void Tools::initColorWheel(desktop::settings::Settings &settings, utils::SanerFo
preview->setMinimumWidth(150);
settings.bindColorWheelShape(preview, &color_widgets::ColorWheel::setSelectorShape);
settings.bindColorWheelAngle(preview, &color_widgets::ColorWheel::setRotatingSelector);
settings.bindColorWheelMirror(preview, &color_widgets::ColorWheel::setMirroredSelector);
settings.bindColorWheelSpace(preview, &color_widgets::ColorWheel::setColorSpace);
form->addAside(preview, startRow);
}
Expand Down
1 change: 1 addition & 0 deletions src/desktop/docks/colorspinner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ColorSpinnerDock::ColorSpinnerDock(const QString& title, QWidget *parent)
settings.bindColorWheelShape(d->colorwheel, &color_widgets::ColorWheel::setSelectorShape, &color_widgets::ColorWheel::selectorShapeChanged);
settings.bindColorWheelAngleAs<bool>(d->colorwheel, &color_widgets::ColorWheel::setRotatingSelector, &color_widgets::ColorWheel::rotatingSelectorChanged);
settings.bindColorWheelSpace(d->colorwheel, &color_widgets::ColorWheel::setColorSpace, &color_widgets::ColorWheel::colorSpaceChanged);
settings.bindColorWheelMirror(d->colorwheel, &color_widgets::ColorWheel::setMirroredSelector, &color_widgets::ColorWheel::mirroredSelectorChanged);
}

ColorSpinnerDock::~ColorSpinnerDock()
Expand Down
1 change: 1 addition & 0 deletions src/desktop/settings_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SETTING(brushOutlineWidth , BrushOutlineWidth , "settings/brusho
SETTING(canvasScrollBars , CanvasScrollBars , "settings/canvasscrollbars" , true)
SETTING(canvasShortcuts , CanvasShortcuts , "settings/canvasshortcuts2" , QVariantMap())
SETTING(colorWheelAngle , ColorWheelAngle , "settings/colorwheel/rotate" , color_widgets::ColorWheel::AngleEnum::AngleRotating)
SETTING(colorWheelMirror , ColorWheelMirror , "settings/colorwheel/mirror" , true)
SETTING(colorWheelShape , ColorWheelShape , "settings/colorwheel/shape" , color_widgets::ColorWheel::ShapeEnum::ShapeTriangle)
SETTING(colorWheelSpace , ColorWheelSpace , "settings/colorwheel/space" , color_widgets::ColorWheel::ColorSpaceEnum::ColorHSV)
SETTING(compactChat , CompactChat , "history/compactchat" , false)
Expand Down

0 comments on commit 852ba83

Please sign in to comment.