Adjusted the layout of dialogs in the desktop application for HiDPI.

master
Pacman Ghost 3 years ago
parent f3e487d03d
commit 864466bbdd
  1. 10
      vasl_templates/main.py
  2. 40
      vasl_templates/ui/about.ui
  3. 24
      vasl_templates/ui/server_settings.ui

@ -24,6 +24,16 @@ import click
from vasl_templates.webapp.utils import SimpleError from vasl_templates.webapp.utils import SimpleError
# NOTE: We're supposed to do the following to support HiDPI, but it causes the main window
# to become extremely large when the Windows zoom level is high (and it doesn't really fix
# the dialog layout problems anyway :-/).# Since we're a webapp running in a browser,
# desktop DPI isn't really an issue for us, we just need to make sure that the Qt dialogs
# look OK. I adjusted the layout for the About box so it's correct for HiDPI; it doesn't
# look great for normal DPI (too much whitespace), but it's useable.
# # nb: this must be done before the QApplication object is created
# QApplication.setAttribute( PyQt5.QtCore.Qt.AA_EnableHighDpiScaling, True )
# QApplication.setAttribute( PyQt5.QtCore.Qt.AA_UseHighDpiPixmaps, True )
# FUDGE! This needs to be created before showing any UI elements e.g. an error message box. # FUDGE! This needs to be created before showing any UI elements e.g. an error message box.
qt_app = QApplication( sys.argv ) qt_app = QApplication( sys.argv )

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>410</width> <width>460</width>
<height>150</height> <height>182</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -40,13 +40,19 @@
<rect> <rect>
<x>80</x> <x>80</x>
<y>20</y> <y>20</y>
<width>321</width> <width>371</width>
<height>44</height> <height>61</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="app_name"> <widget class="QLabel" name="app_name">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<family>DejaVu Sans</family> <family>DejaVu Sans</family>
@ -60,6 +66,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="build_info"> <widget class="QLabel" name="build_info">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<family>DejaVu Sans</family> <family>DejaVu Sans</family>
@ -77,8 +89,8 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>110</y> <y>140</y>
<width>391</width> <width>441</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
@ -118,11 +130,17 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>100</y> <y>120</y>
<width>391</width> <width>441</width>
<height>17</height> <height>21</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>*** HOME URL ***</string> <string>*** HOME URL ***</string>
</property> </property>
@ -134,8 +152,8 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>10</x>
<y>80</y> <y>100</y>
<width>388</width> <width>441</width>
<height>17</height> <height>17</height>
</rect> </rect>
</property> </property>

@ -37,7 +37,7 @@
<x>10</x> <x>10</x>
<y>30</y> <y>30</y>
<width>381</width> <width>381</width>
<height>51</height> <height>58</height>
</rect> </rect>
</property> </property>
<layout class="QFormLayout" name="formLayout_3"> <layout class="QFormLayout" name="formLayout_3">
@ -152,7 +152,7 @@
<x>10</x> <x>10</x>
<y>30</y> <y>30</y>
<width>381</width> <width>381</width>
<height>111</height> <height>116</height>
</rect> </rect>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
@ -357,7 +357,7 @@
<x>10</x> <x>10</x>
<y>30</y> <y>30</y>
<width>381</width> <width>381</width>
<height>81</height> <height>86</height>
</rect> </rect>
</property> </property>
<layout class="QFormLayout" name="formLayout_4"> <layout class="QFormLayout" name="formLayout_4">
@ -446,18 +446,6 @@
</property> </property>
<item> <item>
<widget class="QLabel" name="chapter_h_image_scaling_label"> <widget class="QLabel" name="chapter_h_image_scaling_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>DejaVu Sans</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text"> <property name="text">
<string>Image s&amp;caling:</string> <string>Image s&amp;caling:</string>
</property> </property>
@ -486,12 +474,6 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="font">
<font>
<family>DejaVu Sans</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="inputMask"> <property name="inputMask">
<string/> <string/>
</property> </property>

Loading…
Cancel
Save