Skip to content

Commit

Permalink
set fontscaling for qt until figure out a fix for UI scaling on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
keenanlang committed Jun 21, 2024
1 parent 91e799e commit 5e7bb58
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
9 changes: 6 additions & 3 deletions gestalt/convert/qt/QtGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def generateText(self, node, macros={}):
output.link("borderColor", "border-color")
output.link("borderWidth", "border-width")

output["fontScaleMode"] = Enum("ESimpleLabel::None")
output["fontScaleMode"] = Enum("ESimpleLabel::Height")

return output

Expand All @@ -54,7 +54,7 @@ def generateTextEntry(self, node, macros={}):
output.link("channel", "pv")

output["colorMode"] = Enum("caLineEdit::Static")
output["fontScaleMode"] = Enum("caLineEdit::None")
output["fontScaleMode"] = Enum("caLineEdit::Height")

return output

Expand All @@ -67,7 +67,7 @@ def generateTextMonitor(self, node, macros={}):
output.link("frameLineWidth", "border-width")

output["colorMode"] = Enum("caLineEdit::Static")
output["fontScaleMode"] = Enum("caLineEdit::None")
output["fontScaleMode"] = Enum("caLineEdit::Height")

return output

Expand Down Expand Up @@ -193,6 +193,9 @@ def generatePolyline(self, node, macros={}):

xy_pairs = ""

#my_points = List(node.points)
#my_points.apply(macros)

for point in node.points:
a_point = Rect(point)
a_point.apply(macros)
Expand Down
4 changes: 2 additions & 2 deletions gestalt/convert/qt/QtMessageButton.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, node=None, macros={}):
self.button.link("pressMessage", "value")

self.button["colorMode"] = Enum("caMessageButton::Static")
self.button["fontScaleMode"] = Enum("EPushButton::None")
self.button["fontScaleMode"] = Enum("EPushButton::Height")

def updateProperties(self, macros={}):
super(QtMessageButton, self).updateProperties(macros)
Expand Down Expand Up @@ -53,7 +53,7 @@ def write(self, tree):
QPushButton
{{
font-family: {family};
font: {style} {size}pt;
font: {style};
text-align: {lcr};
}}
Expand Down
12 changes: 6 additions & 6 deletions gestalt/convert/qt/QtRelatedDisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ def __init__(self, node=None, macros={}):
else:
replace += "false;"

self.button["labels"] = String(labels.rstrip(";"))
self.button["files"] = String(files.rstrip(";"))
self.button["args"] = String(args.rstrip(";"))
self.button["removeParent"] = String(replace.rstrip(";"))
self.button["labels"] = String(labels.removesuffix(";"))
self.button["files"] = String(files.removesuffix(";"))
self.button["args"] = String(args.removesuffix(";"))
self.button["removeParent"] = String(replace.removesuffix(";"))

self.button["stackingMode"] = Enum("Menu")
self.button["fontScaleMode"] = Enum("EPushButton::None")
self.button["fontScaleMode"] = Enum("EPushButton::WidthAndHeight")


def updateProperties(self, macros={}):
Expand Down Expand Up @@ -87,7 +87,7 @@ def write(self, tree):
QPushButton
{{
font-family: {family};
font: {style} {size}pt;
font: {style};
text-align: {lcr};
}}
Expand Down
4 changes: 3 additions & 1 deletion gestalt/convert/qt/QtShellCommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def __init__(self, node=None, macros={}):
self.button["files"] = String(commands.rstrip(";"))
self.button["args"] = String(args.rstrip(";"))

self.button["fontScaleMode"] = Enum("EPushButton::WidthAndHeight")


def updateProperties(self, macros={}):
super(QtShellCommand, self).updateProperties(macros)
Expand Down Expand Up @@ -55,7 +57,7 @@ def write(self, tree):
QPushButton
{{
font-family: {family};
font: {style} {size}pt;
font: {style};
text-align: {lcr};
}}
Expand Down

0 comments on commit 5e7bb58

Please sign in to comment.