Bug fix: Close/minimize buttons on theme changes are correct sizes

This commit is contained in:
Kiooeht 2011-06-11 22:54:26 -07:00
parent 397a2b4e24
commit 7f6bb84803
8 changed files with 20 additions and 16 deletions

View file

@ -605,6 +605,7 @@ class WMButton(QtGui.QPushButton):
def __init__(self, icon, parent=None): def __init__(self, icon, parent=None):
QtGui.QPushButton.__init__(self, icon, "", parent) QtGui.QPushButton.__init__(self, icon, "", parent)
self.setIconSize(icon.realsize()) self.setIconSize(icon.realsize())
self.resize(icon.realsize())
self.setFlat(True) self.setFlat(True)
self.setStyleSheet("QPushButton { padding: 0px; }") self.setStyleSheet("QPushButton { padding: 0px; }")
self.setAutoDefault(False) self.setAutoDefault(False)
@ -1836,10 +1837,12 @@ class PesterWindow(MovingWindow):
newcloseicon = PesterIcon(theme["main/close/image"]) newcloseicon = PesterIcon(theme["main/close/image"])
self.closeButton.setIcon(newcloseicon) self.closeButton.setIcon(newcloseicon)
self.closeButton.setIconSize(newcloseicon.realsize()) self.closeButton.setIconSize(newcloseicon.realsize())
self.closeButton.resize(newcloseicon.realsize())
self.closeButton.move(*theme["main/close/loc"]) self.closeButton.move(*theme["main/close/loc"])
newminiicon = PesterIcon(theme["main/minimize/image"]) newminiicon = PesterIcon(theme["main/minimize/image"])
self.miniButton.setIcon(newminiicon) self.miniButton.setIcon(newminiicon)
self.miniButton.setIconSize(newminiicon.realsize()) self.miniButton.setIconSize(newminiicon.realsize())
self.miniButton.resize(newminiicon.realsize())
self.miniButton.move(*theme["main/minimize/loc"]) self.miniButton.move(*theme["main/minimize/loc"])
# menus # menus
self.menu.move(*theme["main/menu/loc"]) self.menu.move(*theme["main/menu/loc"])
@ -2572,7 +2575,8 @@ class PesterWindow(MovingWindow):
# theme # theme
self.themeSelected() self.themeSelected()
# randoms # randoms
self.randhandler.setRandomer(self.optionmenu.randomscheck.isChecked()) if self.randhandler.running:
self.randhandler.setRandomer(self.optionmenu.randomscheck.isChecked())
# button actions # button actions
minisetting = self.optionmenu.miniBox.currentIndex() minisetting = self.optionmenu.miniBox.currentIndex()
curmini = self.config.minimizeAction() curmini = self.config.minimizeAction()

View file

@ -3,9 +3,9 @@
{ "size": [554, 484], { "size": [554, 484],
"background-image": "$path/gbbg.png", "background-image": "$path/gbbg.png",
"close": { "image": "$path/x.png", "close": { "image": "$path/x.png",
"loc": [535, 45]}, "loc": [539, 47]},
"minimize": { "image": "$path/m.png", "minimize": { "image": "$path/m.png",
"loc": [515, 48]}, "loc": [519, 50]},
"menu" : { "loc": [214,44] }, "menu" : { "loc": [214,44] },
"chums": { "style": "border:0px; background-image:url($path/chumbg.png); background-color: rgb(110,110,110); background-repeat: no-repeat; color: white; font-family: 'Arial';selection-background-color:#646464; font-size:16px; ", "chums": { "style": "border:0px; background-image:url($path/chumbg.png); background-color: rgb(110,110,110); background-repeat: no-repeat; color: white; font-family: 'Arial';selection-background-color:#646464; font-size:16px; ",
"loc": [207, 153], "loc": [207, 153],
@ -112,4 +112,4 @@
} }
] ]
} }
} }

View file

@ -6,9 +6,9 @@
"newmsgicon": "$path/trayicon2.png", "newmsgicon": "$path/trayicon2.png",
"windowtitle": "PESTERCHUM 7.0", "windowtitle": "PESTERCHUM 7.0",
"close": { "image": "$path/x.png", "close": { "image": "$path/x.png",
"loc": [315, 26]}, "loc": [319, 28]},
"minimize": { "image": "$path/m.png", "minimize": { "image": "$path/m.png",
"loc": [300, 32]}, "loc": [304, 34]},
"menubar": { "style": "font-family: 'Arial'; font:bold; font-size: 12px; color: #000000;" }, "menubar": { "style": "font-family: 'Arial'; font:bold; font-size: 12px; color: #000000;" },
"menu" : { "style": "font-family: 'Arial'; font: bold; font-size: 12px; color: #000000; background-color: #fdb302;border:2px solid #ffff00", "menu" : { "style": "font-family: 'Arial'; font: bold; font-size: 12px; color: #000000; background-color: #fdb302;border:2px solid #ffff00",
"menuitem": "margin-right:15px;", "menuitem": "margin-right:15px;",

View file

@ -6,9 +6,9 @@
"newmsgicon": "$path/trayicon2.png", "newmsgicon": "$path/trayicon2.png",
"windowtitle": "PESTERCHUM 6.0", "windowtitle": "PESTERCHUM 6.0",
"close": { "image": "$path/x.png", "close": { "image": "$path/x.png",
"loc": [210, 2]}, "loc": [214, 4]},
"minimize": { "image": "$path/m.png", "minimize": { "image": "$path/m.png",
"loc": [194, 8]}, "loc": [198, 10]},
"menubar": { "style": "font-family: 'Courier'; font:bold; font-size: 12px; color: black;" }, "menubar": { "style": "font-family: 'Courier'; font:bold; font-size: 12px; color: black;" },
"menu" : { "style": "font-family: 'Courier'; font: bold; font-size: 12px; color: black; background-color: #fdb302;border:2px solid #ffff00", "menu" : { "style": "font-family: 'Courier'; font: bold; font-size: 12px; color: black; background-color: #fdb302;border:2px solid #ffff00",
"menuitem": "margin-right:10px;", "menuitem": "margin-right:10px;",

View file

@ -10,9 +10,9 @@
"menuitem": "font-size:14px;" }, "menuitem": "font-size:14px;" },
"menubar": { "style": "font-family: 'Courier'; font:bold; font-size: 14px; color: #000000;" }, "menubar": { "style": "font-family: 'Courier'; font:bold; font-size: 14px; color: #000000;" },
"close": { "image": "$path/x.png", "close": { "image": "$path/x.png",
"loc": [282, 4]}, "loc": [286, 6]},
"minimize": { "image": "$path/m.png", "minimize": { "image": "$path/m.png",
"loc": [264, 10]}, "loc": [268, 12]},
"chums": { "style": "border:2px solid yellow; background-color: black;color: white;font: bold;font-size:14px;font-family: 'Courier';selection-background-color:#646464; ", "chums": { "style": "border:2px solid yellow; background-color: black;color: white;font: bold;font-size:14px;font-family: 'Courier';selection-background-color:#646464; ",
"loc": [15, 70], "loc": [15, 70],
"size": [270, 300] "size": [270, 300]

View file

@ -6,9 +6,9 @@
"newmsgicon": "$path/trayicon2.png", "newmsgicon": "$path/trayicon2.png",
"windowtitle": "TROLLIAN", "windowtitle": "TROLLIAN",
"close": { "image": "$path/x.png", "close": { "image": "$path/x.png",
"loc": [635, 2]}, "loc": [639, 4]},
"minimize": { "image": "$path/m.png", "minimize": { "image": "$path/m.png",
"loc": [621, 8]}, "loc": [625, 10]},
"menubar": { "style": "font-family: 'Arial'; font-size: 11px; color: rgba(0,0,0,0);" }, "menubar": { "style": "font-family: 'Arial'; font-size: 11px; color: rgba(0,0,0,0);" },
"menu" : { "style": "font-family: 'Arial'; font-size: 11px; color: #000000; background-color: #c2c2c2; border:1px solid #545454;", "menu" : { "style": "font-family: 'Arial'; font-size: 11px; color: #000000; background-color: #c2c2c2; border:1px solid #545454;",
"selected": "background-color: #545454", "selected": "background-color: #545454",

View file

@ -8,9 +8,9 @@
"menu" : { "style": "font-family: 'Arial'; font: bold; font-size: 14px; color: #000000; background-color: #e5000f;border:2px solid #c20f00" }, "menu" : { "style": "font-family: 'Arial'; font: bold; font-size: 14px; color: #000000; background-color: #e5000f;border:2px solid #c20f00" },
"menubar": { "style": "font-family: 'Arial'; font:bold; font-size: 14px; color: #000000;" }, "menubar": { "style": "font-family: 'Arial'; font:bold; font-size: 14px; color: #000000;" },
"close": { "image": "$path/x.png", "close": { "image": "$path/x.png",
"loc": [280, 2]}, "loc": [272, 0]},
"minimize": { "image": "$path/m.png", "minimize": { "image": "$path/m.png",
"loc": [260, 8]}, "loc": [248, 2]},
"defaultwindow": { "style": "background: #e5000f; font-family:'Arial';font:bold;selection-background-color:#919191; " }, "defaultwindow": { "style": "background: #e5000f; font-family:'Arial';font:bold;selection-background-color:#919191; " },
"chums": { "style": "border:2px solid #ffa4a4; background-color: black;color: white;font: bold;font-size:14px;font-family: 'Arial';selection-background-color:#646464; ", "chums": { "style": "border:2px solid #ffa4a4; background-color: black;color: white;font: bold;font-size:14px;font-family: 'Arial';selection-background-color:#646464; ",
"moods": { "moods": {

View file

@ -6,9 +6,9 @@
"newmsgicon": "$path/trayicon2.png", "newmsgicon": "$path/trayicon2.png",
"windowtitle": "Typewriter", "windowtitle": "Typewriter",
"close": { "image": "$path/x.png", "close": { "image": "$path/x.png",
"loc": [264, 164]}, "loc": [266, 164]},
"minimize": { "image": "$path/m.png", "minimize": { "image": "$path/m.png",
"loc": [239, 168]}, "loc": [240, 169]},
"menubar": { "style": "font-family: 'Courier'; font:bold; font-size: 12px; color: rgba(0,0,0,0);" }, "menubar": { "style": "font-family: 'Courier'; font:bold; font-size: 12px; color: rgba(0,0,0,0);" },
"menu" : { "style": "font-family: 'Courier'; font: bold; font-size: 12px; color: #000000; background-color: white;border:2px solid black;", "menu" : { "style": "font-family: 'Courier'; font: bold; font-size: 12px; color: #000000; background-color: white;border:2px solid black;",
"menuitem": "margin-right:30px;", "menuitem": "margin-right:30px;",