mirror of
https://github.com/lalbornoz/roar.git
synced 2024-11-04 14:56:38 +00:00
f504fa2b76
1) Add background colour toolbar beneath (foreground) colour toolbar. 2) Add colour flipping command w/ {accelerator,{menu,toolbar} item}. 3) Add {de,in}crease {brush,canvas} size accelerator. 4) Add {hide,show} assets window toolbar item. 5) Circle tool: draw outline with foreground colour. 6) Circle tool: honour transparency. 7) Fill tool: change comprehensive fill modifier key from <Shift> to <Ctrl>. 8) Fill tool: fill with {back,fore}ground colour given <[RL]MB> 9) Fix arrow keys cursor motion when scrolled down. 10 Instantly reflect {brush size,colour,tool} changes in canvas. 11) Object tool: honour transparency w/ non-external objects. 12) Object tool: update selection rectangle during <LMB> whilst dragging, set w/ release of <LMB>. 13) Rectangle tool: draw outline with foreground colour. 14) Rectangle tool: honour transparency. 15) Replace wx.ToolBar() w/ wx.lib.agw.aui.AuiToolBar() & custom wx.lib.agw.aui.AuiDefaultToolBarArt(). 16) Restore scrolling position after resizing canvas. .TODO: deleted. assets/audio/roar{arab8,spoke11}.wav: added. assets/text/hotkeys.txt: added to document hotkeys. assets/text/requirements.txt, requirements.txt: moved. assets/text/TODO: updated. {assets/tools,lib{canvas,gui,roar,rtl,tools}}/*.py: remove Vim fold markers. libroar/RoarCanvasCommandsFile.py:_importFile(): update wx.FileDialog() message. libroar/RoarCanvasCommandsOperators.py:canvasOperator(): update invert colours {caption,label}.
44 lines
1.9 KiB
Python
44 lines
1.9 KiB
Python
#!/usr/bin/env python3
|
|
#
|
|
# RoarCanvasCommandsOperators.py
|
|
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
|
|
#
|
|
|
|
from OperatorFlipHorizontal import OperatorFlipHorizontal
|
|
from OperatorFlipVertical import OperatorFlipVertical
|
|
from OperatorInvert import OperatorInvert
|
|
from OperatorRotate import OperatorRotate
|
|
from OperatorTile import OperatorTile
|
|
from GuiFrame import GuiCommandListDecorator
|
|
from ToolObject import ToolObject
|
|
import copy, wx
|
|
|
|
class RoarCanvasCommandsOperators():
|
|
@GuiCommandListDecorator(0, "Flip", "&Flip", None, None, None)
|
|
@GuiCommandListDecorator(1, "Flip horizontally", "Flip &horizontally", None, None, None)
|
|
@GuiCommandListDecorator(2, "Invert colours", "&Invert colours", None, None, None)
|
|
@GuiCommandListDecorator(3, "Rotate", "&Rotate", None, None, None)
|
|
@GuiCommandListDecorator(4, "Tile", "&Tile", None, None, None)
|
|
def canvasOperator(self, f, idx):
|
|
def canvasOperator_(event):
|
|
self.currentOperator = [OperatorFlipVertical, OperatorFlipHorizontal, OperatorInvert, OperatorRotate, OperatorTile][idx]()
|
|
self.operatorState = None
|
|
self.parentCanvas.applyOperator(self.currentTool, self.parentCanvas.brushPos, None, False, self.currentOperator, self.parentCanvas.GetViewStart())
|
|
setattr(canvasOperator_, "attrDict", f.attrList[idx])
|
|
return canvasOperator_
|
|
|
|
|
|
#
|
|
# __init__(self)
|
|
def __init__(self):
|
|
self.accels = ()
|
|
self.menus = (
|
|
("&Operators",
|
|
self.canvasOperator(self.canvasOperator, 0), self.canvasOperator(self.canvasOperator, 1), self.canvasOperator(self.canvasOperator, 2), self.canvasOperator(self.canvasOperator, 3), self.canvasOperator(self.canvasOperator, 4),
|
|
),
|
|
)
|
|
self.toolBars = ()
|
|
self.currentOperator, self.operatorState = None, None
|
|
|
|
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=0
|