eric7/IconEditor/IconEditorGrid.py

branch
eric7
changeset 8873
989b31970862
parent 8857
8191d15b8974
child 8881
54e42bc2437a
equal deleted inserted replaced
8872:ee64dbfefd5f 8873:989b31970862
16 QUndoCommand, QUndoStack 16 QUndoCommand, QUndoStack
17 ) 17 )
18 from PyQt6.QtWidgets import QWidget, QSizePolicy, QApplication, QDialog 18 from PyQt6.QtWidgets import QWidget, QSizePolicy, QApplication, QDialog
19 19
20 from EricWidgets import EricMessageBox 20 from EricWidgets import EricMessageBox
21 from EricWidgets.EricApplication import ericApp
21 22
22 23
23 class IconEditCommand(QUndoCommand): 24 class IconEditCommand(QUndoCommand):
24 """ 25 """
25 Class implementing an undo command for the icon editor. 26 Class implementing an undo command for the icon editor.
427 @param evt reference to the paint event object (QPaintEvent) 428 @param evt reference to the paint event object (QPaintEvent)
428 """ 429 """
429 painter = QPainter(self) 430 painter = QPainter(self)
430 431
431 if self.__zoom >= 3 and self.__gridEnabled: 432 if self.__zoom >= 3 and self.__gridEnabled:
432 # TODO: adjust colors 433 if ericApp().usesDarkPalette():
433 painter.setPen(self.palette().windowText().color()) 434 painter.setPen(self.palette().window().color())
435 else:
436 painter.setPen(self.palette().windowText().color())
434 i = 0 437 i = 0
435 while i <= self.__image.width(): 438 while i <= self.__image.width():
436 painter.drawLine( 439 painter.drawLine(
437 self.__zoom * i, 0, 440 self.__zoom * i, 0,
438 self.__zoom * i, self.__zoom * self.__image.height()) 441 self.__zoom * i, self.__zoom * self.__image.height())

eric ide

mercurial