Commit 12a047fc authored by Dan Pascu's avatar Dan Pascu

Simplified switch button resizing during DND

parent 33511928
...@@ -317,19 +317,14 @@ class SwitchViewButton(QPushButton): ...@@ -317,19 +317,14 @@ class SwitchViewButton(QPushButton):
self.__dict__['dnd_active'] = value self.__dict__['dnd_active'] = value
if value is True: if value is True:
self.dnd_timer.phase = 0 self.dnd_timer.phase = 0
self.original_height = self.height()
self.setStyleSheet(self.dnd_style_sheet1) self.setStyleSheet(self.dnd_style_sheet1)
self.setText(self.button_dnd_text[self.view]) self.setText(self.button_dnd_text[self.view])
self.original_height = self.height() self.setFixedHeight(40)
self.setMinimumHeight(40)
self.setMaximumHeight(40)
self.resize(self.width(), 40)
else: else:
self.setStyleSheet('') self.setStyleSheet('')
self.setText(self.button_text[self.view]) self.setText(self.button_text[self.view])
height = self.original_height self.setFixedHeight(self.original_height)
self.setMinimumHeight(height)
self.setMaximumHeight(height)
self.resize(self.width(), height)
dnd_active = property(_get_dnd_active, _set_dnd_active) dnd_active = property(_get_dnd_active, _set_dnd_active)
del _get_dnd_active, _set_dnd_active del _get_dnd_active, _set_dnd_active
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment