Added code

This commit is contained in:
BarsTiger
2022-08-27 15:45:03 +03:00
commit 51f1d6d831
30 changed files with 1822 additions and 0 deletions

0
ui/__init__.py Normal file
View File

361
ui/gui.py Normal file
View File

@@ -0,0 +1,361 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 400)
MainWindow.setStyleSheet("QWidget {\n"
" background-color: rgba(30, 30, 30, 0.1);\n"
" color: white;\n"
" font: 10pt \"Segoe UI\";\n"
"}\n"
"\n"
"\n"
"QScrollBar:vertical,\n"
"QScrollBar:horizontal {\n"
" border: none;\n"
" background: rgba(30, 30, 30, 0);\n"
" width: 10px;\n"
" margin: 15px 0 15px 0;\n"
" border-radius: 0px;\n"
"}\n"
"\n"
"QScrollBar::handle:vertical,\n"
"QScrollBar::handle:horizontal { \n"
" background-color: rgba(139, 139, 139, 0);\n"
" min-height: 30px;\n"
" border-radius: 5px;\n"
"}\n"
"\n"
"QScrollBar::handle:vertical:hover,\n"
"QScrollBar::handle:vertical:pressed,\n"
"QScrollBar::handle:horizontal:hover,\n"
"QScrollBar::handle:horizontal:pressed { \n"
" background-color: rgba(149, 149, 149, 0);\n"
"}\n"
"\n"
"QScrollBar::sub-line:vertical,\n"
"QScrollBar::add-line:vertical,\n"
"QScrollBar::up-arrow:vertical,\n"
"QScrollBar::down-arrow:vertical {\n"
" height: 0px;\n"
"}\n"
"\n"
"QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical,\n"
"QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical, \n"
"QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal,\n"
"QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {\n"
" background: none;\n"
"}\n"
"\n"
"\n"
"QPushButton {\n"
" color: white;\n"
" border-width: 1px;\n"
" border-radius:6px;\n"
" border-style: solid;\n"
" border-color: rgba(48, 48, 48, 0.5);\n"
" background-color: rgba(44, 45, 46, 0.3);\n"
"}\n"
"QPushButton:hover {\n"
" border-width: 2px;\n"
" background-color: rgba(50, 50, 50, 0.7);\n"
"}\n"
"QPushButton:pressed {\n"
" background-color: rgba(38, 39, 40, 0.7);\n"
"}\n"
"QPushButton:disabled {\n"
" background-color: rgba(67, 67, 67, 0.7);\n"
" border-color: rgba(0, 0, 0, 0.7);\n"
"}\n"
"\n"
"\n"
"QLineEdit, QTextBrowser, QPlainTextEdit, QTextEdit {\n"
" border-width: 1px;\n"
" border-radius: 5px;\n"
" border-style: solid;\n"
" border-color: rgba(48, 48, 48);\n"
" background-color: rgba(36, 36, 36, 0);\n"
" font: 10pt \"Segoe UI\";\n"
"}\n"
"\n"
"\n"
"QListWidget {\n"
" border-width: 1px;\n"
" border-radius: 15px;\n"
" border-style: solid;\n"
" border-color: rgba(48, 48, 48);\n"
" padding: 10px;\n"
" background-color: rgba(100, 100, 100, 0);\n"
" font: 10pt \"Segoe UI\";\n"
"}\n"
"QListWidget:item {\n"
" background-color: rgba(36, 36, 36, 0);\n"
" selection-color: white;\n"
"}\n"
"QListWidget:item:hover {\n"
" background-color: rgba(50, 50, 50, 0);\n"
"}\n"
"QListWidget:item:selected {\n"
" background-color: rgba(119, 119, 119, 1);\n"
"}\n"
"\n"
"\n"
"QComboBox\n"
"{\n"
" border-width: 1px;\n"
" border-radius:6px;\n"
" border-style: solid;\n"
" border-color: rgba(48, 48, 48);\n"
" background-color: rgba(44, 45, 46, 0);\n"
" color: white;\n"
"}\n"
"\n"
"QComboBox::disabled\n"
"{\n"
" background-color: rgba(67, 67, 67, 0);\n"
" color: #656565;\n"
" border-color: rgba(67, 67, 67);\n"
"}\n"
"\n"
"QComboBox:hover\n"
"{\n"
" background-color: rgba(50, 50, 50, 0);\n"
"}\n"
"\n"
"QComboBox:on\n"
"{\n"
" background-color: rgba(67, 67, 67, 0);\n"
"}\n"
"\n"
"QComboBox QAbstractItemView\n"
"{\n"
" background-color: rgba(67, 67, 67, 0);\n"
" color: #ffffff;\n"
" selection-background-color: rgba(119, 119, 119, 0);\n"
" selection-color: white;\n"
" outline: 0;\n"
"}\n"
"\n"
"QComboBox::drop-down\n"
"{\n"
" subcontrol-origin: padding;\n"
" subcontrol-position: top right;\n"
" border-radius: 6px; \n"
"}\n"
"\n"
"\n"
"QTabBar::tab\n"
"{\n"
" background-color: rgba(44, 45, 46, 0);\n"
" color: #ffffff;\n"
" border-style: solid;\n"
" border-width: 1px;\n"
" border-top-left-radius: 3px;\n"
" border-top-right-radius: 3px;\n"
" border-color: rgba(48, 48, 48);\n"
" padding: 5px;\n"
"}\n"
"\n"
"QTabBar::tab:disabled\n"
"{\n"
" background-color: rgba(101, 101, 101, 0);\n"
" color: #656565;\n"
"}\n"
"\n"
"QTabWidget::pane \n"
"{\n"
" background-color: rgba(160, 160, 160, 0);\n"
" color: #ffffff;\n"
" border: 3px solid;\n"
" border-radius: 15px;\n"
" border-color: rgba(28, 28, 28);\n"
"}\n"
"\n"
"QTabBar::tab:selected\n"
"{\n"
" background-color: rgba(38, 39, 40, 0);\n"
" color: #ffffff;\n"
" border-style: solid;\n"
" border-width: 1px;\n"
" border-top-left-radius: 3px;\n"
" border-top-right-radius: 3px;\n"
" border-color: rgba(48, 48, 48);\n"
" padding: 5px;\n"
"}\n"
"\n"
"QTabBar::tab:selected:disabled\n"
"{\n"
" background-color: rgba(64, 64, 64, 0);\n"
" color: #656565;\n"
"}\n"
"\n"
"QTabBar::tab:!selected \n"
"{\n"
" background-color: rgba(38, 38, 38, 0);\n"
"}\n"
"\n"
"QTabBar::tab:!selected:hover \n"
"{\n"
" background-color: rgba(50, 50, 50, 0);\n"
"}\n"
"\n"
"QTabBar::tab:top:!selected \n"
"{\n"
" margin-top: 3px;\n"
"}\n"
"\n"
"QTabBar::tab:bottom:!selected \n"
"{\n"
" margin-bottom: 3px;\n"
"}\n"
"\n"
"QTabBar::tab:top, QTabBar::tab:bottom \n"
"{\n"
" min-width: 8ex;\n"
" margin-right: -1px;\n"
" padding: 5px 10px 5px 10px;\n"
"}\n"
"\n"
"QTabBar::tab:top:selected \n"
"{\n"
" border-bottom-color: none;\n"
"}\n"
"\n"
"QTabBar::tab:bottom:selected \n"
"{\n"
" border-top-color: none;\n"
"}\n"
"\n"
"QTabBar::tab:top:last, QTabBar::tab:bottom:last,\n"
"QTabBar::tab:top:only-one, QTabBar::tab:bottom:only-one \n"
"{\n"
" margin-right: 0;\n"
"}\n"
"\n"
"QTabBar::tab:left:!selected \n"
"{\n"
" margin-right: 3px;\n"
"}\n"
"\n"
"QTabBar::tab:right:!selected\n"
"{\n"
" margin-left: 3px;\n"
"}\n"
"\n"
"QTabBar::tab:left, QTabBar::tab:right \n"
"{\n"
" min-height: 8ex;\n"
" margin-bottom: -1px;\n"
" padding: 10px 5px 10px 5px;\n"
"}\n"
"\n"
"QTabBar::tab:left:selected \n"
"{\n"
" border-left-color: none;\n"
"}\n"
"\n"
"QTabBar::tab:right:selected \n"
"{\n"
" border-right-color: none;\n"
"}\n"
"\n"
"QTabBar::tab:left:last, QTabBar::tab:right:last,\n"
"QTabBar::tab:left:only-one, QTabBar::tab:right:only-one \n"
"{\n"
" margin-bottom: 0;\n"
"}\n"
"\n"
"QSpinBox {\n"
" border-width: 1px;\n"
" border-radius: 5px;\n"
" border-style: solid;\n"
" border-color: rgba(48, 48, 48);\n"
" background-color: rgba(36, 36, 36, 0);\n"
" font: 10pt \"Segoe UI\";\n"
"}\n"
"QSpinBox::up-button {\n"
" border: none;\n"
" background: none;\n"
"}\n"
"QSpinBox::down-button {\n"
" border: none;\n"
" background: none;\n"
"}\n"
"\n"
"QToolBox::tab {\n"
" border-style: solid;\n"
" border-width: 1px;\n"
" border-radius: 5px;\n"
" border-color: rgba(48, 48, 48, 0);\n"
"}")
MainWindow.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName("verticalLayout")
self.page_text = QtWidgets.QPlainTextEdit(self.centralwidget)
self.page_text.setStyleSheet("font: 14pt \"Segoe UI\";")
self.page_text.setObjectName("page_text")
self.verticalLayout.addWidget(self.page_text)
self.index_widget = QtWidgets.QWidget(self.centralwidget)
self.index_widget.setObjectName("index_widget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.index_widget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.back_button = QtWidgets.QPushButton(self.index_widget)
self.back_button.setMinimumSize(QtCore.QSize(64, 64))
self.back_button.setMaximumSize(QtCore.QSize(64, 64))
self.back_button.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/img/img/back.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.back_button.setIcon(icon)
self.back_button.setIconSize(QtCore.QSize(40, 40))
self.back_button.setObjectName("back_button")
self.horizontalLayout.addWidget(self.back_button)
self.page_index = QtWidgets.QLineEdit(self.index_widget)
self.page_index.setMinimumSize(QtCore.QSize(0, 64))
self.page_index.setMaxLength(2932)
self.page_index.setObjectName("page_index")
self.horizontalLayout.addWidget(self.page_index)
self.next_button = QtWidgets.QPushButton(self.index_widget)
self.next_button.setMinimumSize(QtCore.QSize(64, 64))
self.next_button.setMaximumSize(QtCore.QSize(64, 64))
self.next_button.setText("")
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/img/img/next.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.next_button.setIcon(icon1)
self.next_button.setIconSize(QtCore.QSize(40, 40))
self.next_button.setObjectName("next_button")
self.horizontalLayout.addWidget(self.next_button)
self.verticalLayout.addWidget(self.index_widget)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "ConsistentLibraryOfBabel"))
import ui.images_rc
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

411
ui/gui.ui Normal file
View File

@@ -0,0 +1,411 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>400</height>
</rect>
</property>
<property name="windowTitle">
<string>ConsistentLibraryOfBabel</string>
</property>
<property name="styleSheet">
<string notr="true">QWidget {
background-color: rgba(30, 30, 30, 0.1);
color: white;
font: 10pt &quot;Segoe UI&quot;;
}
QScrollBar:vertical,
QScrollBar:horizontal {
border: none;
background: rgba(30, 30, 30, 0);
width: 10px;
margin: 15px 0 15px 0;
border-radius: 0px;
}
QScrollBar::handle:vertical,
QScrollBar::handle:horizontal {
background-color: rgba(139, 139, 139, 0);
min-height: 30px;
border-radius: 5px;
}
QScrollBar::handle:vertical:hover,
QScrollBar::handle:vertical:pressed,
QScrollBar::handle:horizontal:hover,
QScrollBar::handle:horizontal:pressed {
background-color: rgba(149, 149, 149, 0);
}
QScrollBar::sub-line:vertical,
QScrollBar::add-line:vertical,
QScrollBar::up-arrow:vertical,
QScrollBar::down-arrow:vertical {
height: 0px;
}
QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical,
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical,
QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal,
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
background: none;
}
QPushButton {
color: white;
border-width: 1px;
border-radius:6px;
border-style: solid;
border-color: rgba(48, 48, 48, 0.5);
background-color: rgba(44, 45, 46, 0.3);
}
QPushButton:hover {
border-width: 2px;
background-color: rgba(50, 50, 50, 0.7);
}
QPushButton:pressed {
background-color: rgba(38, 39, 40, 0.7);
}
QPushButton:disabled {
background-color: rgba(67, 67, 67, 0.7);
border-color: rgba(0, 0, 0, 0.7);
}
QLineEdit, QTextBrowser, QPlainTextEdit, QTextEdit {
border-width: 1px;
border-radius: 5px;
border-style: solid;
border-color: rgba(48, 48, 48);
background-color: rgba(36, 36, 36, 0);
font: 10pt &quot;Segoe UI&quot;;
}
QListWidget {
border-width: 1px;
border-radius: 15px;
border-style: solid;
border-color: rgba(48, 48, 48);
padding: 10px;
background-color: rgba(100, 100, 100, 0);
font: 10pt &quot;Segoe UI&quot;;
}
QListWidget:item {
background-color: rgba(36, 36, 36, 0);
selection-color: white;
}
QListWidget:item:hover {
background-color: rgba(50, 50, 50, 0);
}
QListWidget:item:selected {
background-color: rgba(119, 119, 119, 1);
}
QComboBox
{
border-width: 1px;
border-radius:6px;
border-style: solid;
border-color: rgba(48, 48, 48);
background-color: rgba(44, 45, 46, 0);
color: white;
}
QComboBox::disabled
{
background-color: rgba(67, 67, 67, 0);
color: #656565;
border-color: rgba(67, 67, 67);
}
QComboBox:hover
{
background-color: rgba(50, 50, 50, 0);
}
QComboBox:on
{
background-color: rgba(67, 67, 67, 0);
}
QComboBox QAbstractItemView
{
background-color: rgba(67, 67, 67, 0);
color: #ffffff;
selection-background-color: rgba(119, 119, 119, 0);
selection-color: white;
outline: 0;
}
QComboBox::drop-down
{
subcontrol-origin: padding;
subcontrol-position: top right;
border-radius: 6px;
}
QTabBar::tab
{
background-color: rgba(44, 45, 46, 0);
color: #ffffff;
border-style: solid;
border-width: 1px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-color: rgba(48, 48, 48);
padding: 5px;
}
QTabBar::tab:disabled
{
background-color: rgba(101, 101, 101, 0);
color: #656565;
}
QTabWidget::pane
{
background-color: rgba(160, 160, 160, 0);
color: #ffffff;
border: 3px solid;
border-radius: 15px;
border-color: rgba(28, 28, 28);
}
QTabBar::tab:selected
{
background-color: rgba(38, 39, 40, 0);
color: #ffffff;
border-style: solid;
border-width: 1px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-color: rgba(48, 48, 48);
padding: 5px;
}
QTabBar::tab:selected:disabled
{
background-color: rgba(64, 64, 64, 0);
color: #656565;
}
QTabBar::tab:!selected
{
background-color: rgba(38, 38, 38, 0);
}
QTabBar::tab:!selected:hover
{
background-color: rgba(50, 50, 50, 0);
}
QTabBar::tab:top:!selected
{
margin-top: 3px;
}
QTabBar::tab:bottom:!selected
{
margin-bottom: 3px;
}
QTabBar::tab:top, QTabBar::tab:bottom
{
min-width: 8ex;
margin-right: -1px;
padding: 5px 10px 5px 10px;
}
QTabBar::tab:top:selected
{
border-bottom-color: none;
}
QTabBar::tab:bottom:selected
{
border-top-color: none;
}
QTabBar::tab:top:last, QTabBar::tab:bottom:last,
QTabBar::tab:top:only-one, QTabBar::tab:bottom:only-one
{
margin-right: 0;
}
QTabBar::tab:left:!selected
{
margin-right: 3px;
}
QTabBar::tab:right:!selected
{
margin-left: 3px;
}
QTabBar::tab:left, QTabBar::tab:right
{
min-height: 8ex;
margin-bottom: -1px;
padding: 10px 5px 10px 5px;
}
QTabBar::tab:left:selected
{
border-left-color: none;
}
QTabBar::tab:right:selected
{
border-right-color: none;
}
QTabBar::tab:left:last, QTabBar::tab:right:last,
QTabBar::tab:left:only-one, QTabBar::tab:right:only-one
{
margin-bottom: 0;
}
QSpinBox {
border-width: 1px;
border-radius: 5px;
border-style: solid;
border-color: rgba(48, 48, 48);
background-color: rgba(36, 36, 36, 0);
font: 10pt &quot;Segoe UI&quot;;
}
QSpinBox::up-button {
border: none;
background: none;
}
QSpinBox::down-button {
border: none;
background: none;
}
QToolBox::tab {
border-style: solid;
border-width: 1px;
border-radius: 5px;
border-color: rgba(48, 48, 48, 0);
}</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPlainTextEdit" name="page_text">
<property name="styleSheet">
<string notr="true">font: 14pt &quot;Segoe UI&quot;;</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="index_widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="back_button">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/img/img/back.png</normaloff>:/img/img/back.png</iconset>
</property>
<property name="iconSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="page_index">
<property name="minimumSize">
<size>
<width>0</width>
<height>64</height>
</size>
</property>
<property name="maxLength">
<number>2932</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="next_button">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/img/img/next.png</normaloff>:/img/img/next.png</iconset>
</property>
<property name="iconSize">
<size>
<width>40</width>
<height>40</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
<resources>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>

6
ui/images.qrc Normal file
View File

@@ -0,0 +1,6 @@
<RCC>
<qresource prefix="img">
<file>img/back.png</file>
<file>img/next.png</file>
</qresource>
</RCC>

120
ui/images_rc.py Normal file
View File

@@ -0,0 +1,120 @@
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x01\xb0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x40\x00\x00\x00\x40\x08\x06\x00\x00\x00\xaa\x69\x71\xde\
\x00\x00\x00\x01\x73\x52\x47\x42\x00\xae\xce\x1c\xe9\x00\x00\x00\
\x04\x67\x41\x4d\x41\x00\x00\xb1\x8f\x0b\xfc\x61\x05\x00\x00\x00\
\x09\x70\x48\x59\x73\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7\x6f\
\xa8\x64\x00\x00\x01\x45\x49\x44\x41\x54\x78\x5e\xed\xdb\x3d\x4a\
\xc4\x50\x18\x46\xe1\x20\xee\x40\xd4\x46\xb4\xb3\xb6\x72\x05\x2e\
\x41\x45\xd4\xb5\xd8\xc4\x85\x45\x88\x45\xec\xf2\xe3\x52\x12\x49\
\x32\xa3\x9e\xc0\x17\xe1\x12\x62\x21\x16\x7a\xbf\xf7\x69\x86\xcc\
\xa4\x39\x2f\x33\x03\x13\x26\x89\x88\xfc\x8a\x3d\x1c\xc3\x0e\x7d\
\x79\x40\xdf\xf7\xc3\x07\xb2\x2c\x7b\x3a\x84\xbd\x14\xbf\x33\x6c\
\xb7\xdb\xf7\x29\x7e\xd6\x34\xcd\xab\x9b\x11\x6e\x60\xdd\x01\x37\
\x23\x1c\xa1\x6d\xdb\xce\xba\x03\x6e\x46\xb8\xc4\x30\x0c\xa3\x75\
\x07\xea\xba\x6e\x5c\x8c\x70\x8b\x71\x1c\x37\xd6\x1d\xa8\xaa\xaa\
\x3e\x80\x9d\x1a\x2f\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\
\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\
\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x00\x8d\x80\x6b\xac\x5d\
\x6d\x2e\x8a\xe2\x65\x17\x76\x6a\xbc\xbe\x7b\x27\x5c\xc0\x4e\xfb\
\xb1\x1d\x7b\xfc\xb3\x36\x98\x62\xed\x30\xb0\xf6\x7c\x34\x5c\x7f\
\x04\xee\xb0\xf6\xd6\x2f\xcb\xb2\xda\x87\x9d\x1a\x1f\xc5\x2b\x7e\
\x49\xf1\x8a\x8f\x94\xe2\x15\xbf\xa4\x78\xc5\x47\x4a\xf1\x2b\xf1\
\xd3\x05\x0e\xd7\xf1\x51\x5f\xdd\x51\xbc\xe2\x97\x14\xaf\xf8\x48\
\x29\xde\x6b\xfc\x15\xdc\xfe\x5d\xfe\x04\x5d\xd7\xbd\x59\x6f\xc0\
\xc5\x0d\x13\xf7\xb0\xde\x80\x9b\xbb\x45\xce\x61\xcd\x5f\x5c\xdd\
\x34\x35\x49\xd3\xf4\x71\xfe\x02\xcc\xf3\xfc\xd9\x55\xfc\x6c\xfa\
\x35\x77\x0a\x3b\x14\x91\xff\x20\x49\x3e\x01\xba\x26\x04\xe0\xd9\
\xf1\x5c\x00\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
\x00\x00\x01\x8a\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x40\x00\x00\x00\x40\x08\x06\x00\x00\x00\xaa\x69\x71\xde\
\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\
\xa7\x93\x00\x00\x01\x3f\x49\x44\x41\x54\x78\x9c\xed\x9b\x31\x2e\
\x04\x61\x00\x46\x1f\x71\x03\x59\xdb\x08\x9d\x88\x4a\xe5\x04\x8e\
\x80\x02\x67\x51\x39\x97\x44\xa1\x51\xb2\xae\x42\x62\x37\x9e\xc2\
\x12\x24\x33\x5b\xd8\x7f\x7e\x3b\xf3\xbd\x72\x36\x99\x7c\xef\x4d\
\x66\x8a\xd9\x5d\x08\x21\xac\x12\xea\x8e\xba\x59\x7b\x47\xe7\xa8\
\x63\xf5\xd6\x0f\x5e\xd5\xab\xda\x9b\x3a\x63\x2e\xff\xe4\x4f\xde\
\xd4\xc3\xbf\x9e\x7b\x7d\x19\x03\x4b\xa2\x8e\x81\x1b\xe0\xe0\xd7\
\x47\x6b\xc0\x7e\xf7\x8b\x3a\xa4\xe1\xca\x7f\xf2\xac\x6e\xd7\xde\
\x58\x8c\xb9\xfc\xa4\x41\x7e\xaa\x9e\xd4\xde\x58\x0c\x75\x4b\x7d\
\x6c\x90\x9f\xa9\xe7\xb5\x37\x16\x23\xf2\x91\x8f\x7c\xe4\x23\x1f\
\xf9\xc8\x47\xbe\x97\x44\x3e\xf2\x91\x8f\x7c\xe4\x23\x1f\xf9\xc8\
\xf7\x92\xc8\x0f\x58\x7e\x43\xbd\x6f\x90\x9f\xaa\x67\xb5\x37\x16\
\x45\x3d\x5e\xe5\x2b\xbf\x8c\x6f\x86\x6c\x39\x3e\x5b\xc2\xf9\xff\
\x37\x83\xbf\x05\x00\xd4\x91\xfa\xd0\x72\x2b\x5c\xd4\xde\x58\x9c\
\x44\x20\x11\x80\x44\x00\x12\x01\x48\x04\x20\x11\x80\x44\x00\x12\
\x01\x48\x04\x20\x11\x80\x44\x00\xbe\x22\xb4\xbd\x40\x19\x44\x84\
\x45\x6f\x91\x12\x21\x11\x12\x21\x11\x12\x21\x11\x12\x61\xb8\x11\
\x16\xfd\x5c\xfe\xb4\xf6\xc6\xe2\xd8\xfe\x87\x89\x17\x75\xb7\xf6\
\xc6\xe2\x2c\x88\x70\x59\x7b\x5f\x27\xb4\x44\x38\xaa\xbd\xad\x33\
\xe6\x11\xee\xbe\x3d\x08\xaf\x6b\x6f\xaa\x82\xba\xa7\x8e\x6a\xef\
\x08\xa1\x27\xbc\x03\x85\x53\x0e\x31\xd2\xc1\xa0\x73\x00\x00\x00\
\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
"
qt_resource_name = b"\
\x00\x03\
\x00\x00\x70\x37\
\x00\x69\
\x00\x6d\x00\x67\
\x00\x08\
\x0c\xf7\x59\xc7\
\x00\x6e\
\x00\x65\x00\x78\x00\x74\x00\x2e\x00\x70\x00\x6e\x00\x67\
\x00\x08\
\x07\x9e\x5a\x47\
\x00\x62\
\x00\x61\x00\x63\x00\x6b\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x03\
\x00\x00\x00\x22\x00\x00\x00\x00\x00\x01\x00\x00\x01\xb4\
\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x03\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x22\x00\x00\x00\x00\x00\x01\x00\x00\x01\xb4\
\x00\x00\x01\x82\x5f\x53\x50\xd3\
\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x82\x5f\x5d\x42\x4b\
"
qt_version = [int(v) for v in QtCore.qVersion().split('.')]
if qt_version < [5, 8, 0]:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()

BIN
ui/img/back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

BIN
ui/img/next.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

0
ui/modules/__init__.py Normal file
View File

133
ui/modules/blur.py Normal file
View File

@@ -0,0 +1,133 @@
# source: https://github.com/Opticos/GWSL-Source/blob/master/blur.py,
# https://www.cnblogs.com/zhiyiYo/p/14659981.html ,
# https://github.com/ifwe/digsby/blob/master/digsby/src/gui/vista.py
import platform
import ctypes
if platform.system() == 'Windows':
from ctypes.wintypes import DWORD, BOOL, HRGN, HWND
user32 = ctypes.windll.user32
dwm = ctypes.windll.dwmapi
class ACCENTPOLICY(ctypes.Structure):
_fields_ = [
("AccentState", ctypes.c_uint),
("AccentFlags", ctypes.c_uint),
("GradientColor", ctypes.c_uint),
("AnimationId", ctypes.c_uint)
]
class WINDOWCOMPOSITIONATTRIBDATA(ctypes.Structure):
_fields_ = [
("Attribute", ctypes.c_int),
("Data", ctypes.POINTER(ctypes.c_int)),
("SizeOfData", ctypes.c_size_t)
]
class DWM_BLURBEHIND(ctypes.Structure):
_fields_ = [
('dwFlags', DWORD),
('fEnable', BOOL),
('hRgnBlur', HRGN),
('fTransitionOnMaximized', BOOL)
]
class MARGINS(ctypes.Structure):
_fields_ = [("cxLeftWidth", ctypes.c_int),
("cxRightWidth", ctypes.c_int),
("cyTopHeight", ctypes.c_int),
("cyBottomHeight", ctypes.c_int)
]
SetWindowCompositionAttribute = user32.SetWindowCompositionAttribute
SetWindowCompositionAttribute.argtypes = (HWND, WINDOWCOMPOSITIONATTRIBDATA)
SetWindowCompositionAttribute.restype = ctypes.c_int
def ExtendFrameIntoClientArea(hwnd):
margins = MARGINS(-1, -1, -1, -1)
dwm.DwmExtendFrameIntoClientArea(hwnd, ctypes.byref(margins))
def Win7Blur(hwnd, Acrylic):
if not Acrylic:
DWM_BB_ENABLE = 0x01
bb = DWM_BLURBEHIND()
bb.dwFlags = DWM_BB_ENABLE
bb.fEnable = 1
bb.hRgnBlur = 1
dwm.DwmEnableBlurBehindWindow(hwnd, ctypes.byref(bb))
else:
ExtendFrameIntoClientArea(hwnd)
def HEXtoRGBAint(HEX: str):
alpha = HEX[7:]
blue = HEX[5:7]
green = HEX[3:5]
red = HEX[1:3]
gradient_color = alpha + blue + green + red
return int(gradient_color, base=16)
def blur(hwnd, hex_color=False, acrylic=False, dark=False):
accent = ACCENTPOLICY()
accent.AccentState = 3 # Default window Blur #ACCENT_ENABLE_BLURBEHIND
gradient_color = 0
if hex_color:
gradient_color = HEXtoRGBAint(hex_color)
accent.AccentFlags = 2 # Window Blur With Accent Color #ACCENT_ENABLE_TRANSPARENTGRADIENT
if acrylic:
accent.AccentState = 4 # UWP but LAG #ACCENT_ENABLE_ACRYLICBLURBEHIND
if not hex_color: # UWP without color is translucent
accent.AccentFlags = 2
gradient_color = HEXtoRGBAint('#12121240') # placeholder color
accent.GradientColor = gradient_color
data = WINDOWCOMPOSITIONATTRIBDATA()
data.Attribute = 19 # WCA_ACCENT_POLICY
data.SizeOfData = ctypes.sizeof(accent)
data.Data = ctypes.cast(ctypes.pointer(accent), ctypes.POINTER(ctypes.c_int))
SetWindowCompositionAttribute(int(hwnd), data)
if dark:
data.Attribute = 26 # WCA_USEDARKMODECOLORS
SetWindowCompositionAttribute(int(hwnd), data)
def BlurLinux(WID): # may not work in all distros (working in Deepin)
import os
c = "xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id " + str(WID)
os.system(c)
def GlobalBlur(hwnd, hex_color=False, acrylic=False, dark=False):
release = platform.release()
system = platform.system()
if system == 'Windows':
if release == 'Vista':
Win7Blur(hwnd, acrylic)
else:
release = int(float(release))
if release == 10 or release == 8 or release == 11:
blur(hwnd, hex_color, acrylic, dark)
else:
Win7Blur(hwnd, acrylic)
if system == 'Linux':
BlurLinux(hwnd)

View File

View File

@@ -0,0 +1,28 @@
from ui.modules.updaters.page_index import update_page_text
from ui.gui import Ui_MainWindow
def on_back_button(ui: Ui_MainWindow):
ui.page_index.setText(str(int(ui.page_index.text()) - 1))
update_page_text(ui)
def on_next_button(ui: Ui_MainWindow):
ui.page_index.setText(str(int(ui.page_index.text()) + 1))
update_page_text(ui)
def on_back_button_press(ui: Ui_MainWindow):
ui.back_timer.start(10)
def on_back_button_release(ui: Ui_MainWindow):
ui.back_timer.stop()
def on_next_button_press(ui: Ui_MainWindow):
ui.next_timer.start(10)
def on_next_button_release(ui: Ui_MainWindow):
ui.next_timer.stop()

View File

View File

@@ -0,0 +1,19 @@
from ui.modules import validators
from ui.modules.handlers import buttons
from ui.gui import Ui_MainWindow
def register_handlers(ui: Ui_MainWindow):
old_page_text_key_press_event = ui.page_text.keyPressEvent
ui.page_text.keyPressEvent = lambda event: validators.validate_page_text(ui, event, old_page_text_key_press_event)
old_page_index_key_press_event = ui.page_index.keyPressEvent
ui.page_index.keyPressEvent = lambda event: validators.validate_page_index(ui, event,
old_page_index_key_press_event)
ui.back_timer.timeout.connect(lambda: buttons.on_back_button(ui))
ui.next_timer.timeout.connect(lambda: buttons.on_next_button(ui))
ui.back_button.pressed.connect(lambda: buttons.on_back_button_press(ui))
ui.back_button.released.connect(lambda: buttons.on_back_button_release(ui))
ui.next_button.pressed.connect(lambda: buttons.on_next_button_press(ui))
ui.next_button.released.connect(lambda: buttons.on_next_button_release(ui))

View File

@@ -0,0 +1,16 @@
from ui.gui import Ui_MainWindow
from ui.modules.blur import GlobalBlur
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtCore import QTimer
from ui.modules.initialize import handlers
def on_load(ui: Ui_MainWindow, MainWindow: QMainWindow):
ui.page_index.setText('0')
ui.page_index.setMaxLength(2_147_483_647)
ui.back_timer = QTimer()
ui.next_timer = QTimer()
GlobalBlur(MainWindow.winId(), acrylic=True)
handlers.register_handlers(ui)

582
ui/modules/styles.py Normal file
View File

@@ -0,0 +1,582 @@
centralwidget_b = """
QWidget {
background-color: rgba(30, 30, 30, 0.1);
color: white;
font: 10pt "Segoe UI";
}
QScrollBar:vertical,
QScrollBar:horizontal {
border: none;
background: rgba(30, 30, 30, 0);
width: 10px;
margin: 15px 0 15px 0;
border-radius: 0px;
}
QScrollBar::handle:vertical,
QScrollBar::handle:horizontal {
background-color: rgba(139, 139, 139, 0);
min-height: 30px;
border-radius: 5px;
}
QScrollBar::handle:vertical:hover,
QScrollBar::handle:vertical:pressed,
QScrollBar::handle:horizontal:hover,
QScrollBar::handle:horizontal:pressed {
background-color: rgba(149, 149, 149, 0);
}
QScrollBar::sub-line:vertical,
QScrollBar::add-line:vertical,
QScrollBar::up-arrow:vertical,
QScrollBar::down-arrow:vertical {
height: 0px;
}
QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical,
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical,
QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal,
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
background: none;
}
QPushButton {
color: white;
border-width: 1px;
border-radius:6px;
border-style: solid;
border-color: rgba(48, 48, 48, 0.5);
background-color: rgba(44, 45, 46, 0.3);
}
QPushButton:hover {
border-width: 2px;
background-color: rgba(50, 50, 50, 0.7);
}
QPushButton:pressed {
background-color: rgba(38, 39, 40, 0.7);
}
QPushButton:disabled {
background-color: rgba(67, 67, 67, 0.7);
border-color: rgba(0, 0, 0, 0.7);
}
QLineEdit, QTextBrowser, QPlainTextEdit, QTextEdit {
border-width: 1px;
border-radius: 5px;
border-style: solid;
border-color: rgba(48, 48, 48);
background-color: rgba(36, 36, 36, 0);
font: 10pt "Segoe UI";
}
QListWidget {
border-width: 1px;
border-radius: 15px;
border-style: solid;
border-color: rgba(48, 48, 48);
padding: 10px;
background-color: rgba(100, 100, 100, 0);
font: 10pt "Segoe UI";
}
QListWidget:item {
background-color: rgba(36, 36, 36, 0);
selection-color: white;
}
QListWidget:item:hover {
background-color: rgba(50, 50, 50, 0);
}
QListWidget:item:selected {
background-color: rgba(119, 119, 119, 1);
}
QComboBox
{
border-width: 1px;
border-radius:6px;
border-style: solid;
border-color: rgba(48, 48, 48);
background-color: rgba(44, 45, 46, 0);
color: white;
}
QComboBox::disabled
{
background-color: rgba(67, 67, 67, 0);
color: #656565;
border-color: rgba(67, 67, 67);
}
QComboBox:hover
{
background-color: rgba(50, 50, 50, 0);
}
QComboBox:on
{
background-color: rgba(67, 67, 67, 0);
}
QComboBox QAbstractItemView
{
background-color: rgba(67, 67, 67, 0);
color: #ffffff;
selection-background-color: rgba(119, 119, 119, 0);
selection-color: white;
outline: 0;
}
QComboBox::drop-down
{
subcontrol-origin: padding;
subcontrol-position: top right;
border-radius: 6px;
}
QTabBar::tab
{
background-color: rgba(44, 45, 46, 0);
color: #ffffff;
border-style: solid;
border-width: 1px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-color: rgba(48, 48, 48);
padding: 5px;
}
QTabBar::tab:disabled
{
background-color: rgba(101, 101, 101, 0);
color: #656565;
}
QTabWidget::pane
{
background-color: rgba(160, 160, 160, 0);
color: #ffffff;
border: 3px solid;
border-radius: 15px;
border-color: rgba(28, 28, 28);
}
QTabBar::tab:selected
{
background-color: rgba(38, 39, 40, 0);
color: #ffffff;
border-style: solid;
border-width: 1px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-color: rgba(48, 48, 48);
padding: 5px;
}
QTabBar::tab:selected:disabled
{
background-color: rgba(64, 64, 64, 0);
color: #656565;
}
QTabBar::tab:!selected
{
background-color: rgba(38, 38, 38, 0);
}
QTabBar::tab:!selected:hover
{
background-color: rgba(50, 50, 50, 0);
}
QTabBar::tab:top:!selected
{
margin-top: 3px;
}
QTabBar::tab:bottom:!selected
{
margin-bottom: 3px;
}
QTabBar::tab:top, QTabBar::tab:bottom
{
min-width: 8ex;
margin-right: -1px;
padding: 5px 10px 5px 10px;
}
QTabBar::tab:top:selected
{
border-bottom-color: none;
}
QTabBar::tab:bottom:selected
{
border-top-color: none;
}
QTabBar::tab:top:last, QTabBar::tab:bottom:last,
QTabBar::tab:top:only-one, QTabBar::tab:bottom:only-one
{
margin-right: 0;
}
QTabBar::tab:left:!selected
{
margin-right: 3px;
}
QTabBar::tab:right:!selected
{
margin-left: 3px;
}
QTabBar::tab:left, QTabBar::tab:right
{
min-height: 8ex;
margin-bottom: -1px;
padding: 10px 5px 10px 5px;
}
QTabBar::tab:left:selected
{
border-left-color: none;
}
QTabBar::tab:right:selected
{
border-right-color: none;
}
QTabBar::tab:left:last, QTabBar::tab:right:last,
QTabBar::tab:left:only-one, QTabBar::tab:right:only-one
{
margin-bottom: 0;
}
QSpinBox {
border-width: 1px;
border-radius: 5px;
border-style: solid;
border-color: rgba(48, 48, 48);
background-color: rgba(36, 36, 36, 0);
font: 10pt "Segoe UI";
}
QSpinBox::up-button {
border: none;
background: none;
}
QSpinBox::down-button {
border: none;
background: none;
}
QToolBox::tab {
border-style: solid;
border-width: 1px;
border-radius: 5px;
border-color: rgba(48, 48, 48, 0);
}
"""
menupage_b = """
QListWidget {
border-width: 0px;
border-radius: 0px;
border: none;
padding: 0px;
background-color: rgba(36, 36, 36, 0);
font: 10pt "Segoe UI";
}
QListWidget:item {
padding-left: 10px;
height: 60px;
background-color: rgba(25, 25, 25, 0);
selection-color: rgba(255, 255, 255);
}
QListWidget:item:hover {
background-color: rgba(50, 50, 50, 0);
}
QListWidget:item:selected {
background-color: rgba(38, 39, 40, 0);
}
"""
centralwidget_g = """
QWidget {
background-color: rgb(30, 30, 30);
color: rgb(255, 255, 255);
font: 10pt "Segoe UI";
}
QScrollBar:vertical,
QScrollBar:horizontal {
border: none;
background: rgb(30, 30, 30);
width: 10px;
margin: 15px 0 15px 0;
border-radius: 0px;
}
QScrollBar::handle:vertical,
QScrollBar::handle:horizontal {
background-color: rgb(139, 139, 139);
min-height: 30px;
border-radius: 5px;
}
QScrollBar::handle:vertical:hover,
QScrollBar::handle:vertical:pressed,
QScrollBar::handle:horizontal:hover,
QScrollBar::handle:horizontal:pressed {
background-color: rgb(149, 149, 149);
}
QScrollBar::sub-line:vertical,
QScrollBar::add-line:vertical,
QScrollBar::up-arrow:vertical,
QScrollBar::down-arrow:vertical {
height: 0px;
}
QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical,
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical,
QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal,
QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal {
background: none;
}
QPushButton {
color: white;
border-width: 1px;
border-radius:6px;
border-style: solid;
border-color: #303030;
background-color: #2c2d2e;
}
QPushButton:hover {
border-width: 2px;
background-color: #323232;
}
QPushButton:pressed {
background-color: #262728;
}
QPushButton:disabled {
background-color: #434343;
border-color: #0000;
}
QLineEdit, QTextBrowser, QPlainTextEdit, QTextEdit {
border-width: 1px;
border-radius: 5px;
border-style: solid;
border-color: #303030;
background-color: #242424;
font: 10pt "Segoe UI";
}
QListWidget {
border-width: 1px;
border-radius: 15px;
border-style: solid;
border-color: #303030;
padding: 10px;
background-color: #242424;
font: 10pt "Segoe UI";
}
QListWidget:item {
background-color: #242424;
selection-color: white;
}
QListWidget:item:hover {
background-color: #323232;
}
QListWidget:item:selected {
background-color: #777777;
}
QComboBox
{
border-width: 1px;
border-radius:6px;
border-style: solid;
border-color: #303030;
background-color: #2c2d2e;
color: #ffffff;
}
QComboBox::disabled
{
background-color: #434343;
color: #656565;
border-color: #434343;
}
QComboBox:hover
{
background-color: #323232;
}
QComboBox:on
{
background-color: #434343;
}
QComboBox QAbstractItemView
{
background-color: #434343;
color: #ffffff;
selection-background-color: #777777;
selection-color: white;
outline: 0;
}
QComboBox::drop-down
{
subcontrol-origin: padding;
subcontrol-position: top right;
border-radius: 6px;
}
QTabBar::tab
{
background-color: #2c2d2e;
color: #ffffff;
border-style: solid;
border-width: 1px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-color: #303030;
padding: 5px;
}
QTabBar::tab:disabled
{
background-color: #656565;
color: #656565;
}
QTabWidget::pane
{
background-color: #a0a0a0;
color: #ffffff;
border: 3px solid;
border-radius: 15px;
border-color: #1c1c1c;
}
QTabBar::tab:selected
{
background-color: #262728;
color: #ffffff;
border-style: solid;
border-width: 1px;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-color: #303030;
padding: 5px;
}
QTabBar::tab:selected:disabled
{
background-color: #404040;
color: #656565;
}
QTabBar::tab:!selected
{
background-color: #262626;
}
QTabBar::tab:!selected:hover
{
background-color: #323232;
}
QTabBar::tab:top:!selected
{
margin-top: 3px;
}
QTabBar::tab:bottom:!selected
{
margin-bottom: 3px;
}
QTabBar::tab:top, QTabBar::tab:bottom
{
min-width: 8ex;
margin-right: -1px;
padding: 5px 10px 5px 10px;
}
QTabBar::tab:top:selected
{
border-bottom-color: none;
}
QTabBar::tab:bottom:selected
{
border-top-color: none;
}
QTabBar::tab:top:last, QTabBar::tab:bottom:last,
QTabBar::tab:top:only-one, QTabBar::tab:bottom:only-one
{
margin-right: 0;
}
QTabBar::tab:left:!selected
{
margin-right: 3px;
}
QTabBar::tab:right:!selected
{
margin-left: 3px;
}
QTabBar::tab:left, QTabBar::tab:right
{
min-height: 8ex;
margin-bottom: -1px;
padding: 10px 5px 10px 5px;
}
QTabBar::tab:left:selected
{
border-left-color: none;
}
QTabBar::tab:right:selected
{
border-right-color: none;
}
QTabBar::tab:left:last, QTabBar::tab:right:last,
QTabBar::tab:left:only-one, QTabBar::tab:right:only-one
{
margin-bottom: 0;
}
QSpinBox {
border-width: 1px;
border-radius: 5px;
border-style: solid;
border-color: #303030;
background-color: #242424;
font: 10pt "Segoe UI";
}
QSpinBox::up-button {
border: none;
background: none;
}
QSpinBox::down-button {
border: none;
background: none;
}
QToolBox::tab {
border-style: solid;
border-width: 1px;
border-radius: 5px;
border-color: #303030;
}
"""
menupage_g = """
QListWidget {
border-width: 0px;
border-radius: 0px;
border: none;
padding: 0px;
background-color: #242424;
font: 10pt "Segoe UI";
}
QListWidget:item {
padding-left: 10px;
height: 60px;
background-color: #191919;
selection-color: rgba(255, 255, 255);
}
QListWidget:item:hover {
background-color: #323232;
}
QListWidget:item:selected {
background-color: #262728;
}
"""

View File

View File

@@ -0,0 +1,13 @@
from modules.generator.pages import Page
from ui.gui import Ui_MainWindow
def update_page_text(ui: Ui_MainWindow):
if ui.page_index.text() == str():
ui.page_text.setPlainText('')
return
try:
ui.page_text.setPlainText(Page.from_index(int(ui.page_index.text())))
except:
ui.page_text.setPlainText('Something went wrong, change index or text here.')

View File

@@ -0,0 +1,6 @@
from modules.generator.pages import Index
from ui.gui import Ui_MainWindow
def update_page_index(ui: Ui_MainWindow):
ui.page_index.setText(str(Index.from_page(ui.page_text.toPlainText())))

View File

@@ -0,0 +1,2 @@
from .page_text import *
from .page_index import *

View File

@@ -0,0 +1,14 @@
from ui.modules.updaters.page_index import update_page_text
from ui.gui import Ui_MainWindow
from PyQt5 import QtGui
def validate_page_index(ui: Ui_MainWindow, event: QtGui.QKeyEvent, old_event):
old_event(event)
for char in ui.page_index.text():
if char not in '0123456789':
ui.page_index.setText(''.join(c for c in ui.page_index.text() if c in '0123456789'))
ui.page_index.setCursorPosition(QtGui.QTextCursor.End)
break
update_page_text(ui)

View File

@@ -0,0 +1,15 @@
from ui.modules.updaters.page_text import update_page_index
from modules.config import charset
from ui.gui import Ui_MainWindow
from PyQt5 import QtGui
def validate_page_text(ui: Ui_MainWindow, event: QtGui.QKeyEvent, old_event):
old_event(event)
for char in ui.page_text.toPlainText():
if char not in charset:
ui.page_text.setPlainText(''.join(c for c in ui.page_text.toPlainText() if c in charset))
ui.page_text.moveCursor(QtGui.QTextCursor.End)
break
update_page_index(ui)