style stuff :)

This commit is contained in:
Dpeta 2021-03-25 17:52:43 +01:00
parent 05536b167f
commit 684846a804
4 changed files with 28 additions and 3 deletions

View file

@ -18,7 +18,7 @@ Download the appropriate release for your platform from [releases][releases], ex
## BUILDING ## BUILDING
Building Pesterchum yourself is not required to run it!!! This is only relevant if you know what you're doing >:3c Building Pesterchum yourself is not required to run it!!! This is only relevant if you know what you're doing >:3c
### PYTHON :) ### REQUIREMENTS:
- [Python 3] - [Python 3]

View file

@ -855,6 +855,7 @@ class PesterMemo(PesterConvo):
else: else:
self.close() self.close()
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setStyleSheet("QMessageBox{" + self.theme["main/defaultwindow/style"] + "}")
msgbox.setText("%s: Invites only!" % (c)) msgbox.setText("%s: Invites only!" % (c))
msgbox.setInformativeText("This channel is invite-only. You must get an invitation from someone on the inside before entering.") msgbox.setInformativeText("This channel is invite-only. You must get an invitation from someone on the inside before entering.")
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok) msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok)
@ -1012,6 +1013,7 @@ class PesterMemo(PesterConvo):
if chum is self.mainwindow.profile(): if chum is self.mainwindow.profile():
# are you next? # are you next?
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setStyleSheet("QMessageBox{" + self.theme["main/defaultwindow/style"] + "}")
msgbox.setText(self.mainwindow.theme["convo/text/kickedmemo"]) msgbox.setText(self.mainwindow.theme["convo/text/kickedmemo"])
msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd") msgbox.setInformativeText("press 0k to rec0nnect or cancel to absc0nd")
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel) msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel)

View file

@ -703,7 +703,20 @@ class chumArea(RightClickTree):
self.resize(*theme["main/chums/size"]) self.resize(*theme["main/chums/size"])
self.move(*theme["main/chums/loc"]) self.move(*theme["main/chums/loc"])
if "main/chums/scrollbar" in theme: if "main/chums/scrollbar" in theme:
self.setStyleSheet("QListWidget { %s } QScrollBar { %s } QScrollBar::handle { %s } QScrollBar::add-line { %s } QScrollBar::sub-line { %s } QScrollBar:up-arrow { %s } QScrollBar:down-arrow { %s }" % (theme["main/chums/style"], theme["main/chums/scrollbar/style"], theme["main/chums/scrollbar/handle"], theme["main/chums/scrollbar/downarrow"], theme["main/chums/scrollbar/uparrow"], theme["main/chums/scrollbar/uarrowstyle"], theme["main/chums/scrollbar/darrowstyle"] )) self.setStyleSheet("QListWidget { %s } \
QScrollBar { %s } \
QScrollBar::handle { %s } \
QScrollBar::add-line { %s } \
QScrollBar::sub-line { %s } \
QScrollBar:up-arrow { %s } \
QScrollBar:down-arrow { %s }" % \
(theme["main/chums/style"], \
theme["main/chums/scrollbar/style"], \
theme["main/chums/scrollbar/handle"], \
theme["main/chums/scrollbar/downarrow"], \
theme["main/chums/scrollbar/uparrow"], \
theme["main/chums/scrollbar/uarrowstyle"], \
theme["main/chums/scrollbar/darrowstyle"] ))
else: else:
self.setStyleSheet(theme["main/chums/style"]) self.setStyleSheet(theme["main/chums/style"])
self.pester.setText(theme["main/menus/rclickchumlist/pester"]) self.pester.setText(theme["main/menus/rclickchumlist/pester"])
@ -822,6 +835,7 @@ class chumArea(RightClickTree):
gname = str(gname) gname = str(gname)
if re.search("[^A-Za-z0-9_\s]", gname) is not None: if re.search("[^A-Za-z0-9_\s]", gname) is not None:
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setStyleSheet("QMessageBox{" + self.theme["main/defaultwindow/style"] + "}")
msgbox.setInformativeText("THIS IS NOT A VALID GROUP NAME") msgbox.setInformativeText("THIS IS NOT A VALID GROUP NAME")
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok) msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok)
ret = msgbox.exec_() ret = msgbox.exec_()
@ -1076,6 +1090,7 @@ class PesterWindow(MovingWindow):
except: except:
self.userprofile = userProfile(PesterProfile("pesterClient%d" % (random.randint(100,999)), QtGui.QColor("black"), Mood(0))) self.userprofile = userProfile(PesterProfile("pesterClient%d" % (random.randint(100,999)), QtGui.QColor("black"), Mood(0)))
self.theme = self.userprofile.getTheme() self.theme = self.userprofile.getTheme()
self.modes = "" self.modes = ""
self.sound_type = None self.sound_type = None
@ -1746,12 +1761,17 @@ class PesterWindow(MovingWindow):
self.currentMoodIcon.hide() self.currentMoodIcon.hide()
self.currentMoodIcon = None self.currentMoodIcon = None
# This is a better spot to put this :)
# Setting QMessageBox's style usually doesn't do anything.
self.setStyleSheet("QInputDialog { %s } QMessageBox { %s }" % (self.theme["main/defaultwindow/style"], self.theme["main/defaultwindow/style"]))
if theme["main/mychumhandle/colorswatch/text"]: if theme["main/mychumhandle/colorswatch/text"]:
self.mychumcolor.setText(theme["main/mychumhandle/colorswatch/text"]) self.mychumcolor.setText(theme["main/mychumhandle/colorswatch/text"])
else: else:
self.mychumcolor.setText("") self.mychumcolor.setText("")
if _CONSOLE: if _CONSOLE:
if self.console.window: if self.console.window:
# A bit of an ugly hack.... # A bit of an ugly hack....
@ -1996,6 +2016,7 @@ class PesterWindow(MovingWindow):
if h.upper() == "NICKSERV" and m.startswith("Your nickname is now being changed to"): if h.upper() == "NICKSERV" and m.startswith("Your nickname is now being changed to"):
changedto = m[39:-1] changedto = m[39:-1]
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setStyleSheet("QMessageBox{" + self.theme["main/defaultwindow/style"] + "}")
msgbox.setText("This chumhandle has been registered; you may not use it.") msgbox.setText("This chumhandle has been registered; you may not use it.")
msgbox.setInformativeText("Your handle is now being changed to %s." % (changedto)) msgbox.setInformativeText("Your handle is now being changed to %s." % (changedto))
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok) msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok)
@ -2013,6 +2034,7 @@ class PesterWindow(MovingWindow):
def deliverInvite(self, handle, channel): def deliverInvite(self, handle, channel):
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setText("You're invited!") msgbox.setText("You're invited!")
msgbox.setStyleSheet("QMessageBox{" + self.theme["main/defaultwindow/style"] + "}")
msgbox.setInformativeText("%s has invited you to the memo: %s\nWould you like to join them?" % (handle, channel)) msgbox.setInformativeText("%s has invited you to the memo: %s\nWould you like to join them?" % (handle, channel))
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel) msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel)
# Find the Cancel button and make it default # Find the Cancel button and make it default
@ -2405,7 +2427,6 @@ class PesterWindow(MovingWindow):
self.quirkmenu = None self.quirkmenu = None
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def openChat(self): def openChat(self):
self.setStyleSheet("QInputDialog {" + self.theme["convo/tabwindow/style"] + "}")
if not hasattr(self, "openchatdialog"): if not hasattr(self, "openchatdialog"):
self.openchatdialog = None self.openchatdialog = None
if not self.openchatdialog: if not self.openchatdialog:
@ -2445,6 +2466,7 @@ class PesterWindow(MovingWindow):
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setInformativeText("THIS IS NOT A VALID GROUP NAME") msgbox.setInformativeText("THIS IS NOT A VALID GROUP NAME")
msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok) msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok)
msgbox.setStyleSheet("QMessageBox{" + self.theme["main/defaultwindow/style"] + "}")#Style :) (memos/style or convo/style works :3 )
ret = msgbox.exec_() ret = msgbox.exec_()
self.addgroupdialog = None self.addgroupdialog = None
return return

View file

@ -60,6 +60,7 @@ class RandomHandler(QtCore.QObject):
if l[1] == "x": if l[1] == "x":
from PyQt5 import QtGui, QtWidgets from PyQt5 import QtGui, QtWidgets
msgbox = QtWidgets.QMessageBox() msgbox = QtWidgets.QMessageBox()
msgbox.setStyleSheet("QMessageBox{" + self.theme["main/defaultwindow/style"] + "}")
msgbox.setText("Unable to fetch you a random encounter!") msgbox.setText("Unable to fetch you a random encounter!")
msgbox.setInformativeText("Try again later :(") msgbox.setInformativeText("Try again later :(")
msgbox.exec_() msgbox.exec_()