Skip to content

Commit

Permalink
Merge pull request #16 from wojtryb/development
Browse files Browse the repository at this point in the history
Deploy v1.1.0
  • Loading branch information
wojtryb authored Jan 20, 2023
2 parents 02034f1 + 1298247 commit 29608a1
Show file tree
Hide file tree
Showing 59 changed files with 1,862 additions and 693 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Change Log

## [1.1.0] - 2023-01-20
### Added
- Edit mode for PieMenus - click or drag the value icon to enter it. While in edit mode, the values can be dragged across the PieMenu to change their order.
- Action values tab in Configure Shortcut Composer for adding and removing values in PieMenus and MultipleAssignment actions.
- PieValues backtrounds are now animated.
- New PieMenu to create a layer with chosen blending mode.

### Fixed
- Allow scrolling through masks while using layey mouse trackers
- Make sure that presets in PieMenu are displayed only once.
- Allow using "Enclose and fill" tool
- Fix icon of "Colorize Mask" and "Color Sampler" tools
- Fix scaling issues of Text labels in PieMenu

## [1.0.1] - 2023-01-09
Fixes following issues:
- Fix displaying inactive presets and tags
- Detect and support light krita theme, switch between them when changed
- PieWidget as popup - pies no longer recognized by OS as windows
- Allow different parameters for each configuration value
- Use default font to fix MacOS helvetica issue
- Allow using actions when active layer is locked
- Work around krita bug: zoom being dependent on document dpi
51 changes: 40 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,25 @@ The plugin adds new shortcuts of the following types:

[![PIE MENUS - introducing Shortcut Composer](http://img.youtube.com/vi/hrjBycVYFZM/0.jpg)](https://www.youtube.com/watch?v=hrjBycVYFZM "PIE MENUS - introducing Shortcut Composer")

## What's new in v1.0.1
Fixes following issues:
- Fix displaying inactive presets and tags
- Detect and support light krita theme, switch between them when changed
- PieWidget as popup - pies no longer recognized by OS as windows
- Allow different parameters for each configuration value
- Use default font to fix MacOS helvetica issue
- Allow using actions when active layer is locked
- Work around krita bug: zoom being dependent on document dpi
## What's new in v1.1.0
### Added
- Edit mode for PieMenus - click or drag the value icon to enter it. While in edit mode, the values can be dragged across the PieMenu to change their order.
- Action values tab in Configure Shortcut Composer for adding and removing values in PieMenus and MultipleAssignment actions.
- PieValues backtrounds are now animated.
- New PieMenu to create a layer with chosen blending mode.

### Fixed
- Allow scrolling through masks while using layey mouse trackers
- Make sure that presets in PieMenu are displayed only once.
- Allow using "Enclose and fill" tool
- Fix icon of "Colorize Mask" tool
- Fix icon of "Colorize Mask" and "Color Sampler" tools
- Fix scaling issues of Text labels in PieMenu

## Requirements
Shortcut Composer **v1.0.1** Requires krita **5.1.0** or later.
Shortcut Composer **v1.1.0** Requires krita **5.1.0** or later.

Supported operating systems:
OS support state:
- [x] Windows 10/11
- [x] Linux
- [ ] MacOS (Known bug of canvas losing focus after using PieMenu)
Expand All @@ -43,6 +48,8 @@ While Shortcut-Composer is highly configurable and extendable, the add-on comes
### (`Pie menus`):
Pie menu is a widget displayed on the canvas while a key is pressed. It will disappear as soon, as the key is released. Moving cursor in a direction of a icon, activates its value on key release. **The action does not recognise mouse clicks, and only requires hovering**. Pie menu does nothing if the cursor is not moved out of the deadzone.

Dragging a value enters `Edit mode` in which the keyboard button no longer needs to be pressed. In this mode values can be dragged accross the widget to change their order. When done, press the tick button to apply the changes.

- ### Pick brush presets (red, green, blue)
Three color coded pie menus that let you pick a **brush preset** from related **tag** with brush presets. Used tags can be changed in **Tools > Scripts > Configure Shortcut Composer**. Default tag mapping is as follows:
- <span style="color:red">red</span>: "★ My Favorites"
Expand All @@ -69,6 +76,18 @@ Pie menu is a widget displayed on the canvas while a key is pressed. It will dis
- screen,
- darken,
- lighten

- ### Create painting layer with blending mode
Pie menu for creating a new layer with picked **blending mode**. Consists of most commonly used ones:
- normal
- erase
- overlay,
- color,
- multiply,
- add,
- screen,
- darken,
- lighten

### (`Cursor trackers`):
Cursor tracker is an action for switching values using cursor movement, while the keyboard key is pressed. It changes a single krita property according to the cursor movement along horizontal or vertical axis. **The action does not recognise mouse clicks, and only requires hovering**
Expand Down Expand Up @@ -159,6 +178,16 @@ Shortcut-Composer comes with a settings dialog available from krita topbar: **To
- `Pie deadzone global scale` - Global scale factor for the deadzone area of every pie menu.
- `Pie animation time` - Time (in seconds) for fade-in animation when showing the pie menu.

### Changing the values in Pie menus and Multiple assignments
**Configure Shortcut Composer** has a separate tab called `Action values` in which you can add new values to some of the actions, as well as remove those that are not needed.

Action to modify can be selected using the combobox on the top.

Values are added by selecting the list value(s) on the left and pressing the green **add** button. Analogically, selecting values on the right, and pressing the **remove** button, removes the values from action.

Dragging values on the right, allow to change their order. This can also be done using the `Edit mode` directly from the PieMenu (does not apply to MultipleAssignments)


### Modifying actions and creating custom ones
While the settings dialog allows to tweak the values common for plugin actions, it does not allow to modify the behaviour of the actions or create new ones.

Expand Down
4 changes: 4 additions & 0 deletions shortcut_composer/actions.action
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
<activationFlags>1</activationFlags>
</Action>

<Action name="Create painting layer with blending mode">
<activationFlags>1</activationFlags>
</Action>

</Actions>
<Actions category="Scripts">
<text>Shortcut Composer: Utilities</text>
Expand Down
55 changes: 19 additions & 36 deletions shortcut_composer/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@

from PyQt5.QtGui import QColor

from api_krita.enums import BlendingMode, Tool, Toggle
from api_krita.enums import BlendingMode, Tool, Toggle, TransformMode
from core_components import instructions, controllers
from composer_utils import Config
from input_adapter import ComplexAction
from data_components import (
CurrentLayerStack,
PickStrategy,
EnumConfigValues,
TagConfigValues,
Slider,
Range,
Tag,
)
infinity = float("inf")

Expand Down Expand Up @@ -94,11 +95,7 @@ def create_actions() -> List[ComplexAction]: return [
name="Cycle selection tools",
controller=controllers.ToolController(),
default_value=Tool.FREEHAND_BRUSH,
values=[
Tool.FREEHAND_SELECTION,
Tool.RECTANGULAR_SELECTION,
Tool.CONTIGUOUS_SELECTION,
],
values=EnumConfigValues(Config.SELECTION_TOOLS_VALUES, Tool),
),

# Control undo and redo actions by sliding the cursor horizontally
Expand Down Expand Up @@ -186,13 +183,7 @@ def create_actions() -> List[ComplexAction]: return [
templates.PieMenu(
name="Pick misc tools",
controller=controllers.ToolController(),
values=[
Tool.CROP,
Tool.REFERENCE,
Tool.GRADIENT,
Tool.MULTI_BRUSH,
Tool.ASSISTANTS,
],
values=EnumConfigValues(Config.MISC_TOOLS_VALUES, Tool),
pie_radius_scale=0.9
),

Expand All @@ -202,30 +193,22 @@ def create_actions() -> List[ComplexAction]: return [
name="Pick painting blending modes",
controller=controllers.BlendingModeController(),
instructions=[instructions.SetBrushOnNonPaintable()],
values=[
BlendingMode.NORMAL,
BlendingMode.OVERLAY,
BlendingMode.COLOR,
BlendingMode.MULTIPLY,
BlendingMode.ADD,
BlendingMode.SCREEN,
BlendingMode.DARKEN,
BlendingMode.LIGHTEN,
],
values=EnumConfigValues(Config.BLENDING_MODES_VALUES, BlendingMode),
),

# Use pie menu to create painting layer with selected blending mode.
templates.PieMenu(
name="Create painting layer with blending mode",
controller=controllers.CreateLayerWithBlendingController(),
values=EnumConfigValues(
Config.CREATE_BLENDING_LAYER_VALUES, BlendingMode),
),

# Pick one of the transform tool modes.
templates.PieMenu(
name="Pick transform tool modes",
controller=controllers.ToolController(),
values=[
Tool.TRANSFORM_FREE,
Tool.TRANSFORM_PERSPECTIVE,
Tool.TRANSFORM_WARP,
Tool.TRANSFORM_CAGE,
Tool.TRANSFORM_LIQUIFY,
Tool.TRANSFORM_MESH,
],
controller=controllers.TransformModeController(),
values=EnumConfigValues(Config.TRANSFORM_MODES_VALUES, TransformMode),
),

# Use pie menu to pick one of presets from tag specified in settings.
Expand All @@ -234,7 +217,7 @@ def create_actions() -> List[ComplexAction]: return [
name="Pick brush presets (red)",
controller=controllers.PresetController(),
instructions=[instructions.SetBrushOnNonPaintable()],
values=Tag(Config.TAG_RED.read()),
values=TagConfigValues(Config.TAG_RED, Config.TAG_RED_VALUES),
background_color=QColor(95, 65, 65, 190),
active_color=QColor(200, 70, 70),
),
Expand All @@ -245,7 +228,7 @@ def create_actions() -> List[ComplexAction]: return [
name="Pick brush presets (green)",
controller=controllers.PresetController(),
instructions=[instructions.SetBrushOnNonPaintable()],
values=Tag(Config.TAG_GREEN.read()),
values=TagConfigValues(Config.TAG_GREEN, Config.TAG_GREEN_VALUES),
background_color=QColor(65, 95, 65, 190),
active_color=QColor(70, 200, 70),
),
Expand All @@ -256,7 +239,7 @@ def create_actions() -> List[ComplexAction]: return [
name="Pick brush presets (blue)",
controller=controllers.PresetController(),
instructions=[instructions.SetBrushOnNonPaintable()],
values=Tag(Config.TAG_BLUE.read()),
values=TagConfigValues(Config.TAG_BLUE, Config.TAG_BLUE_VALUES),
background_color=QColor(70, 70, 105, 190),
active_color=QColor(110, 160, 235),
),
Expand Down
4 changes: 2 additions & 2 deletions shortcut_composer/api_krita/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: © 2022 Wojciech Trybus <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later

from .transform_actions import TransformModeActions
from .transform_actions import TransformModeActions, TransformModeFinder

__all__ = ["TransformModeActions"]
__all__ = ["TransformModeActions", "TransformModeFinder"]
Loading

0 comments on commit 29608a1

Please sign in to comment.