Skip to content

Commit

Permalink
Merge pull request #84 from wojtryb/development
Browse files Browse the repository at this point in the history
Deploy 1.5.3
  • Loading branch information
wojtryb authored Apr 6, 2024
2 parents 30a6e50 + 1e46fd8 commit d70c14e
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Shortcut composer **v1.5.2**
# Shortcut composer **v1.5.3**

[![python](https://img.shields.io/badge/Python-3.10-3776AB.svg?style=flat&logo=python&logoColor=white)](https://www.python.org)
[![Code style: black](https://img.shields.io/badge/code%20style-autopep8-333333.svg)](https://pypi.org/project/autopep8/)
Expand Down
2 changes: 1 addition & 1 deletion shortcut_composer/INFO.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from api_krita.wrappers import Version

__version__ = Version(1, 5, 2)
__version__ = Version(1, 5, 3)
"""Version of the Shortcut Composer plugin."""

__required_krita_version__ = Version(5, 2, 2)
Expand Down
2 changes: 1 addition & 1 deletion shortcut_composer/api_krita/pyqt/round_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
def show(self) -> None:
"""Change the size and repaint the button."""
radius = self._radius_callback()
self.setGeometry(0, 0, radius*2, radius*2)
self.resize(radius*2, radius*2)

active_color = self._active_color_callback()
background_color = self._background_color_callback()
Expand Down
2 changes: 1 addition & 1 deletion shortcut_composer/composer_utils/label/label_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
self.label = label
self._label_widget_style = label_widget_style

self.setGeometry(0, 0, self.icon_radius*2, self.icon_radius*2)
self.resize(self.icon_radius*2, self.icon_radius*2)
self.setCursor(Qt.ArrowCursor)

self._draggable = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _create_pyqt_label(self) -> QLabel:
label = QLabel(self)
label.setText(to_display.value)
label.setAlignment(Qt.AlignCenter)
label.setGeometry(0, 0, round(height*2), round(height))
label.resize(round(height*2), round(height))
label.setFont(self._font)
label.move(self.center.x()-height,
self.center.y()-height//2)
Expand Down
2 changes: 1 addition & 1 deletion shortcut_composer/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<body>

<h1 id="shortcut-composer-v1-5-2-">Shortcut composer <strong>v1.5.2</strong></h1>
<h1 id="shortcut-composer-v1-5-3-">Shortcut composer <strong>v1.5.3</strong></h1>
<hr>
<p><strong><code>Extension</code></strong> for painting application <strong><code>Krita</code></strong>, which allows to create custom, complex <strong><code>keyboard shortcuts</code></strong>.</p>
<p>The plugin adds new shortcuts of the following types:</p>
Expand Down
4 changes: 2 additions & 2 deletions shortcut_composer/templates/pie_menu_utils/pie_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(
) -> None:
AnimatedWidget.__init__(self, parent, Config.PIE_ANIMATION_TIME.read())
diameter = 2*style_holder.pie_style.widget_radius
self.setGeometry(0, 0, diameter, diameter)
self.resize(diameter, diameter)

self.setAcceptDrops(True)
self.setWindowFlags((
Expand Down Expand Up @@ -171,4 +171,4 @@ def _type(self) -> type | None:
def _reset(self) -> None:
"""Set widget geometry according to style."""
diameter = 2*self._style_holder.pie_style.widget_radius
self.setGeometry(0, 0, diameter, diameter)
self.resize(diameter, diameter)
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# SPDX-FileCopyrightText: © 2022-2024 Wojciech Trybus <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later

from PyQt5.QtWidgets import QDialog
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QVBoxLayout

from api_krita.pyqt import BaseWidget
from composer_utils import ButtonsLayout
from config_system.ui import (
ConfigFormWidget,
Expand All @@ -17,7 +16,7 @@
from .rotation_config import RotationConfig


class RotationSettings(BaseWidget):
class RotationSettings(QDialog):
"""Widget that allows to change values in passed config."""

def __init__(self, config: RotationConfig) -> None:
Expand Down Expand Up @@ -127,7 +126,6 @@ def __init__(self, config: RotationConfig) -> None:
def show(self) -> None:
"""Show the dialog after refreshing all its elements."""
self.refresh()
self.move_center(QCursor.pos())
return super().show()

def apply(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def paintEvent(self, event: QPaintEvent) -> None:

def _resize(self) -> None:
"""Change the widget window to value required by its configuration."""
self.setGeometry(0, 0, self._diameter, self._diameter)
self.resize(self._diameter, self._diameter)

@property
def _diameter(self) -> int:
Expand Down
3 changes: 3 additions & 0 deletions shortcut_composer/templates/rotation_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ def on_key_press(self) -> None:
if (self._config.IS_WIDGET_HIDDEN.read()
and not self._rotation_settings.isVisible()):
self._global_settings_button.show()
mdiArea = Krita.get_active_mdi_area()
self._global_settings_button.move(
mdiArea.mapToGlobal(mdiArea.pos()))

def on_every_key_release(self) -> None:
"""Handle the key release event."""
Expand Down

0 comments on commit d70c14e

Please sign in to comment.