Skip to content

Commit

Permalink
Merge pull request #40 from wojtryb/development
Browse files Browse the repository at this point in the history
Deploy v1.2.2
  • Loading branch information
wojtryb authored Apr 14, 2023
2 parents fdfd597 + 2765d98 commit 84b6a5c
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The plugin adds new shortcuts of the following types:

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


- [hotfix **1.2.2**] - Fixed MultipleAssignment actions sharing one configuration window.
- [hotfix **1.2.1**] - Fixed pie menus in edit mode hiding when clicked outside on the canvas.


Expand All @@ -34,7 +34,7 @@ The plugin adds new shortcuts of the following types:
- Make `input_adapter` package independent from the rest of the plugin to improve re-usability.
- Fix crash when picking a deleted preset with PieMenu.

Check out historic [changelogs](https://github.com/wojtryb/Shortcut-Composer/wiki/Change-log).
Check out historic [changelogs](https://github.com/wojtryb/Shortcut-Composer/releases).

## Plugin release video:

Expand Down
2 changes: 1 addition & 1 deletion shortcut_composer/INFO.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: © 2022-2023 Wojciech Trybus <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later

__version__ = "1.2.1"
__version__ = "1.2.2"
__author__ = "Wojciech Trybus"
__license__ = "GPL-3.0-or-later"
6 changes: 5 additions & 1 deletion shortcut_composer/core_components/instruction_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ class InstructionHolder:
respective method in every stored Instruction.
"""

def __init__(self, instructions: List[Instruction] = []) -> None:
def __init__(self, instructions: List[Instruction]) -> None:
self._instructions = instructions

def append(self, instruction: Instruction):
"""Add new instruction to the list on runtime."""
self._instructions.append(instruction)

def _template(self, method_name: str) -> None:
"""Perform method `method_name` of each held instruction."""
for instruction in self._instructions:
Expand Down
3 changes: 2 additions & 1 deletion shortcut_composer/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h1 id="shortcut-composer">Shortcut composer</h1>
</ul>
<h2 id="what-s-new-in-1-2-">What&#39;s new in <strong>1.2</strong></h2>
<ul>
<li>[hotfix **1.2.2**] - Fixed MultipleAssignment actions sharing one configuration window.</li>
<li>[hotfix **1.2.1**] - Fixed pie menus in edit mode hiding when clicked outside on the canvas.</li>
</ul>
<h3 id="added">Added</h3>
Expand Down Expand Up @@ -63,7 +64,7 @@ <h3 id="fixed">Fixed</h3>
</li>
<li>Fix crash when picking a deleted preset with PieMenu.</li>
</ul>
<p>Check out historic <a href="https://github.com/wojtryb/Shortcut-Composer/wiki/Change-log">changelogs</a>.</p>
<p>Check out historic <a href="https://github.com/wojtryb/Shortcut-Composer/releases">changelogs</a>.</p>
<h2 id="requirements">Requirements</h2>
<ul>
<li>Version of krita on plugin release: <strong>5.1.5</strong></li>
Expand Down
9 changes: 6 additions & 3 deletions shortcut_composer/templates/multiple_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(
controller: Controller[T],
values: List[T],
default_value: Optional[T] = None,
instructions: List[Instruction] = [],
instructions: Optional[List[Instruction]] = None,
short_vs_long_press_time: Optional[float] = None
) -> None:
super().__init__(name, instructions, short_vs_long_press_time)
Expand All @@ -75,11 +75,14 @@ def __init__(
self._default_value = self._read_default_value(default_value)

self.config = Field(
config_group=f"ShortcutComposer: {name}",
config_group=f"ShortcutComposer: {self.name}",
name="Values",
default=values)

self._settings = SettingsHandler(name, self.config, instructions)
self._settings = SettingsHandler(
self.name,
self.config,
self._instructions)
self._values_to_cycle = self.config.read()

def reset() -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# SPDX-FileCopyrightText: © 2022-2023 Wojciech Trybus <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later

from typing import List
from enum import Enum

from PyQt5.QtGui import QColor

from api_krita import Krita
from api_krita.pyqt import RoundButton, Timer
from core_components import Instruction
from core_components import Instruction, InstructionHolder
from config_system import Field
from .action_values_window import ActionValuesWindow

Expand All @@ -29,7 +28,7 @@ def __init__(
self,
name: str,
config: Field[list],
instructions: List[Instruction],
instructions: InstructionHolder,
) -> None:
to_cycle = config.read()
if not to_cycle or not isinstance(to_cycle[0], Enum):
Expand Down
2 changes: 1 addition & 1 deletion shortcut_composer/templates/pie_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(
name: str,
controller: Controller[T],
values: List[T],
instructions: List[Instruction] = [],
instructions: Optional[List[Instruction]] = None,
pie_radius_scale: float = 1.0,
icon_radius_scale: float = 1.0,
background_color: Optional[QColor] = None,
Expand Down
5 changes: 3 additions & 2 deletions shortcut_composer/templates/raw_instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ class RawInstructions(ComplexActionInterface):
def __init__(
self,
name: str,
instructions: List[Instruction] = [],
instructions: Optional[List[Instruction]] = None,
short_vs_long_press_time: Optional[float] = None
) -> None:
self.name = name
self.short_vs_long_press_time = _read_time(short_vs_long_press_time)
self._instructions = InstructionHolder(instructions)
self._instructions = InstructionHolder(
instructions if instructions is not None else [])

def on_key_press(self) -> None:
"""Run instructions meant for key press event."""
Expand Down
2 changes: 1 addition & 1 deletion shortcut_composer/templates/temporary_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(
controller: Controller[T],
high_value: T,
low_value: Optional[T] = None,
instructions: List[Instruction] = [],
instructions: Optional[List[Instruction]] = None,
short_vs_long_press_time: Optional[float] = None
) -> None:
super().__init__(name, instructions, short_vs_long_press_time)
Expand Down

0 comments on commit 84b6a5c

Please sign in to comment.