Some tweaks to dialog design

This commit is contained in:
Veronica K. B. Olsen
2019-06-15 23:10:15 +02:00
parent 21b7e882ac
commit f80e9cf94a
8 changed files with 72 additions and 116 deletions
+7 -3
View File
@@ -14,9 +14,11 @@ import logging
import configparser import configparser
import nw import nw
from os import path, mkdir, getcwd from os import path, mkdir, getcwd
from appdirs import user_config_dir from appdirs import user_config_dir
from datetime import datetime from datetime import datetime
from nw.constants import nwFiles
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -43,6 +45,7 @@ class Config:
self.homePath = None self.homePath = None
self.appPath = None self.appPath = None
self.appRoot = None self.appRoot = None
self.appIcon = None
self.guiPath = None self.guiPath = None
self.themeRoot = None self.themeRoot = None
self.themePath = None self.themePath = None
@@ -111,6 +114,7 @@ class Config:
self.guiPath = path.join(self.appPath,"gui") self.guiPath = path.join(self.appPath,"gui")
self.themeRoot = path.join(self.appPath,"themes") self.themeRoot = path.join(self.appPath,"themes")
self.themePath = path.join(self.themeRoot) self.themePath = path.join(self.themeRoot)
self.appIcon = path.join(self.appRoot, nwFiles.APP_ICON)
# If config folder does not exist, make it. # If config folder does not exist, make it.
# This assumes that the os config folder itself exists. # This assumes that the os config folder itself exists.
-38
View File
@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg1014"
version="1.1"
viewBox="0 0 40 40"
height="40mm"
width="40mm">
<defs
id="defs1008" />
<metadata
id="metadata1011">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,-257)"
id="layer1">
<rect
y="257"
x="-1.7763568e-15"
height="40"
width="40"
id="rect1580"
style="fill:#646464;fill-opacity:0.39351851;stroke:none;stroke-width:0.18425357;stroke-linecap:square;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

+48
View File
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
width="280px"
height="279.416px"
viewBox="340 140 280 279.416"
enable-background="new 340 140 280 279.416"
xml:space="preserve"
sodipodi:docname="gear.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
id="metadata9"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs7" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1013"
id="namedview5"
showgrid="false"
inkscape:zoom="0.84461882"
inkscape:cx="22.787362"
inkscape:cy="139.70799"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" />
<path
d="M620,305.666v-51.333l-31.5-5.25c-2.333-8.75-5.833-16.917-9.917-23.917L597.25,199.5l-36.167-36.75l-26.25,18.083 c-7.583-4.083-15.75-7.583-23.916-9.917L505.667,140h-51.334l-5.25,31.5c-8.75,2.333-16.333,5.833-23.916,9.916L399.5,163.333 L362.75,199.5l18.667,25.666c-4.083,7.584-7.583,15.75-9.917,24.5l-31.5,4.667v51.333l31.5,5.25 c2.333,8.75,5.833,16.334,9.917,23.917l-18.667,26.25l36.167,36.167l26.25-18.667c7.583,4.083,15.75,7.583,24.5,9.917l5.25,30.916 h51.333l5.25-31.5c8.167-2.333,16.333-5.833,23.917-9.916l26.25,18.666l36.166-36.166l-18.666-26.25 c4.083-7.584,7.583-15.167,9.916-23.917L620,305.666z M480,333.666c-29.75,0-53.667-23.916-53.667-53.666s24.5-53.667,53.667-53.667 S533.667,250.25,533.667,280S509.75,333.666,480,333.666z"
id="path2"
style="fill:#000000;fill-opacity:0.35408559" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

-60
View File
@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
id="svg1014"
version="1.1"
viewBox="0 0 40 40"
height="40mm"
width="40mm">
<defs
id="defs1008">
<linearGradient
id="linearGradient1586">
<stop
id="stop1582"
offset="0"
style="stop-color:#646464;stop-opacity:0" />
<stop
id="stop1584"
offset="1"
style="stop-color:#646464;stop-opacity:1" />
</linearGradient>
<linearGradient
gradientTransform="matrix(0.90450234,0,0,0.53447864,-9.5726494,251.5932)"
gradientUnits="userSpaceOnUse"
y2="47.535713"
x2="54.938839"
y1="47.535713"
x1="10.451041"
id="linearGradient1588"
xlink:href="#linearGradient1586" />
</defs>
<metadata
id="metadata1011">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,-257)"
id="layer1">
<rect
y="257"
x="-1.7763568e-15"
height="40"
width="40"
id="rect1580"
style="fill:url(#linearGradient1588);fill-opacity:1;stroke:none;stroke-width:0.18425357;stroke-linecap:square;stroke-miterlimit:10;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

+5 -5
View File
@@ -15,7 +15,7 @@ import nw
from os import path from os import path
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush, QStandardItemModel, QFont from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush, QStandardItemModel, QFont
from PyQt5.QtSvg import QSvgWidget from PyQt5.QtSvg import QSvgWidget
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import (
@@ -43,9 +43,9 @@ class GuiConfigEditor(QDialog):
self.setWindowTitle("Preferences") self.setWindowTitle("Preferences")
self.gradPath = path.abspath(path.join(self.mainConf.appPath,"graphics","block.svg")) self.gradPath = path.abspath(path.join(self.mainConf.appPath,"graphics","gear.svg"))
self.svgGradient = QSvgWidget(self.gradPath) self.svgGradient = QSvgWidget(path.join(self.gradPath))
self.svgGradient.setFixedWidth(80) self.svgGradient.setFixedSize(QSize(64,64))
self.theProject.countStatus() self.theProject.countStatus()
self.tabMain = GuiConfigEditGeneral(self.theParent) self.tabMain = GuiConfigEditGeneral(self.theParent)
@@ -56,7 +56,7 @@ class GuiConfigEditor(QDialog):
self.tabWidget.addTab(self.tabEditor, "Editor") self.tabWidget.addTab(self.tabEditor, "Editor")
self.setLayout(self.outerBox) self.setLayout(self.outerBox)
self.outerBox.addWidget(self.svgGradient) self.outerBox.addWidget(self.svgGradient, 0, Qt.AlignTop)
self.outerBox.addLayout(self.innerBox) self.outerBox.addLayout(self.innerBox)
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
+5 -3
View File
@@ -15,6 +15,7 @@ import nw
from os import path from os import path
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtWidgets import QDialog, QHBoxLayout, QVBoxLayout, QGroupBox, QFormLayout, QLineEdit, QPushButton, QComboBox from PyQt5.QtWidgets import QDialog, QHBoxLayout, QVBoxLayout, QGroupBox, QFormLayout, QLineEdit, QPushButton, QComboBox
from PyQt5.QtSvg import QSvgWidget from PyQt5.QtSvg import QSvgWidget
@@ -40,11 +41,12 @@ class GuiItemEditor(QDialog):
self.setWindowTitle("Item Settings") self.setWindowTitle("Item Settings")
self.gradPath = path.abspath(path.join(self.mainConf.appPath,"graphics","block.svg")) self.gradPath = path.abspath(path.join(self.mainConf.appPath,"graphics","gear.svg"))
self.svgGradient = QSvgWidget(self.gradPath) self.svgGradient = QSvgWidget(self.gradPath)
self.svgGradient.setFixedWidth(80) self.svgGradient.setFixedSize(QSize(64,64))
self.setLayout(self.outerBox) self.setLayout(self.outerBox)
self.outerBox.addWidget(self.svgGradient) self.outerBox.addWidget(self.svgGradient, 0, Qt.AlignTop)
self.outerBox.addLayout(self.innerBox) self.outerBox.addLayout(self.innerBox)
self.mainGroup = QGroupBox("Item Settings") self.mainGroup = QGroupBox("Item Settings")
+6 -6
View File
@@ -15,7 +15,7 @@ import nw
from os import path from os import path
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush, QStandardItemModel from PyQt5.QtGui import QIcon, QPixmap, QColor, QBrush, QStandardItemModel
from PyQt5.QtSvg import QSvgWidget from PyQt5.QtSvg import QSvgWidget
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import (
@@ -37,14 +37,15 @@ class GuiProjectEditor(QDialog):
self.mainConf = nw.CONFIG self.mainConf = nw.CONFIG
self.theParent = theParent self.theParent = theParent
self.theProject = theProject self.theProject = theProject
self.outerBox = QHBoxLayout() self.outerBox = QHBoxLayout()
self.innerBox = QVBoxLayout() self.innerBox = QVBoxLayout()
self.setWindowTitle("Project Settings") self.setWindowTitle("Project Settings")
self.setLayout(self.outerBox)
self.gradPath = path.abspath(path.join(self.mainConf.appPath,"graphics","block.svg")) self.gradPath = path.abspath(path.join(self.mainConf.appPath,"graphics","gear.svg"))
self.svgGradient = QSvgWidget(self.gradPath) self.svgGradient = QSvgWidget(self.gradPath)
self.svgGradient.setFixedWidth(80) self.svgGradient.setFixedSize(QSize(64,64))
self.theProject.countStatus() self.theProject.countStatus()
self.tabMain = GuiProjectEditMain(self.theParent, self.theProject) self.tabMain = GuiProjectEditMain(self.theParent, self.theProject)
@@ -58,8 +59,7 @@ class GuiProjectEditor(QDialog):
self.tabWidget.addTab(self.tabImport, "Importance") self.tabWidget.addTab(self.tabImport, "Importance")
self.tabWidget.addTab(self.tabReplace,"Auto-Replace") self.tabWidget.addTab(self.tabReplace,"Auto-Replace")
self.setLayout(self.outerBox) self.outerBox.addWidget(self.svgGradient, 0, Qt.AlignTop)
self.outerBox.addWidget(self.svgGradient)
self.outerBox.addLayout(self.innerBox) self.outerBox.addLayout(self.innerBox)
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
+1 -1
View File
@@ -58,7 +58,7 @@ class GuiMain(QMainWindow):
self.resize(*self.mainConf.winGeometry) self.resize(*self.mainConf.winGeometry)
self._setWindowTitle() self._setWindowTitle()
self.setWindowIcon(QIcon(path.join(self.mainConf.appRoot, nwFiles.APP_ICON))) self.setWindowIcon(QIcon(path.join(self.mainConf.appIcon)))
# Main GUI Elements # Main GUI Elements
self.statusBar = GuiMainStatus(self) self.statusBar = GuiMainStatus(self)