Window.BringToFront() implemented. Fix for element Update that uses colors
This commit is contained in:
parent
a49bbd2834
commit
a845a6778b
|
@ -456,13 +456,18 @@ class Element():
|
||||||
|
|
||||||
def Update(self, widget, background_color=None, text_color=None, font=None, visible=None):
|
def Update(self, widget, background_color=None, text_color=None, font=None, visible=None):
|
||||||
style = str(widget.styleSheet())
|
style = str(widget.styleSheet())
|
||||||
|
add_brace = False
|
||||||
|
if len(style) != 0 and style[-1] == '}':
|
||||||
|
style = style[:-1]
|
||||||
|
add_brace = True
|
||||||
if font is not None:
|
if font is not None:
|
||||||
style += create_style_from_font(font)
|
style += create_style_from_font(font)
|
||||||
if text_color is not None:
|
if text_color is not None:
|
||||||
style += 'color: %s;' % text_color
|
style += ' color: %s;' % text_color
|
||||||
if background_color is not None:
|
if background_color is not None:
|
||||||
style += 'background-color: %s;' % background_color
|
style += 'background-color: %s;' % background_color
|
||||||
# print(style)
|
if add_brace:
|
||||||
|
style += '}'
|
||||||
widget.setStyleSheet(style)
|
widget.setStyleSheet(style)
|
||||||
set_widget_visiblity(widget, visible)
|
set_widget_visiblity(widget, visible)
|
||||||
|
|
||||||
|
@ -3505,10 +3510,7 @@ class Window:
|
||||||
def BringToFront(self):
|
def BringToFront(self):
|
||||||
self.QTMainWindow.activateWindow(self.QT_QMainWindow)
|
self.QTMainWindow.activateWindow(self.QT_QMainWindow)
|
||||||
self.QTMainWindow.raise_(self.QT_QMainWindow)
|
self.QTMainWindow.raise_(self.QT_QMainWindow)
|
||||||
# try:
|
|
||||||
# self.TKroot.lift()
|
|
||||||
# except:
|
|
||||||
# pass
|
|
||||||
|
|
||||||
def CurrentLocation(self):
|
def CurrentLocation(self):
|
||||||
location = self.QT_QMainWindow.geometry()
|
location = self.QT_QMainWindow.geometry()
|
||||||
|
|
Loading…
Reference in New Issue