optimize imports and cleanup code
This commit is contained in:
@@ -1,44 +1,11 @@
|
||||
from PyQt5 import QtWidgets, QtGui
|
||||
from PyQt5.QtWidgets import QWidget, QSizePolicy, QVBoxLayout, QDoubleSpinBox, QMessageBox
|
||||
|
||||
from app_config import AppCfg #option, toggle_option
|
||||
|
||||
|
||||
def toggle_warn(key):
|
||||
toggle_option(key)
|
||||
m = f"Option {key} => {option(key)}"
|
||||
QMessageBox.warning(None, m, m)
|
||||
from PyQt5.QtWidgets import QWidget, QSizePolicy, QVBoxLayout, QMessageBox
|
||||
|
||||
def horiz_spacer():
|
||||
spacer = QWidget()
|
||||
spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
||||
return spacer
|
||||
|
||||
|
||||
def toggle_visibility(widget, state):
|
||||
if state:
|
||||
widget.show()
|
||||
else:
|
||||
widget.hide()
|
||||
|
||||
|
||||
def get_sep_line():
|
||||
line = QtWidgets.QFrame()
|
||||
line.setFixedHeight(2)
|
||||
line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
return line
|
||||
|
||||
|
||||
def check_font_by_id(id):
|
||||
for family in QtGui.QFontDatabase.applicationFontFamilies(id):
|
||||
print(family)
|
||||
|
||||
|
||||
def toggle_groupbox(gbox, state):
|
||||
widget = gbox.layout().itemAt(0).widget()
|
||||
widget.setVisible(state)
|
||||
|
||||
def add_item_to_toolbox(toolbox, label, widget_list=[]):
|
||||
block = QWidget()
|
||||
block.setAccessibleName(label)
|
||||
|
||||
Reference in New Issue
Block a user