Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
MenxLi committed Jun 5, 2023
1 parent 59cf1c7 commit 6d1754a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
12 changes: 10 additions & 2 deletions resbibman/GUIs/mainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Literal, Tuple, List, Callable
from PyQt6 import QtGui
from PyQt6.QtGui import QIcon, QKeySequence
from PyQt6.QtWidgets import QDialog, QFileDialog, QMainWindow, QMenu, QMenuBar, QSplitter, QWidget, QHBoxLayout, QToolBar, QTabWidget, QTabBar
from PyQt6.QtWidgets import QDialog, QFileDialog, QMainWindow, QMenu, QMenuBar, QSplitter, QWidget, QHBoxLayout, QToolBar, QTabWidget, QTabBar, QApplication
from PyQt6.QtGui import QAction
from PyQt6.QtCore import Qt, QThreadPool

Expand All @@ -26,7 +26,7 @@
from ..core.serverConn import ServerConn
from ..core.dataClass import DataTags, DataBase, DataPoint
from ..confReader import getConf, ICON_PATH, getConfV, getDatabase, saveToConf, saveToConf_guiStatus
from ..confReader import TMP_DB, TMP_WEB, TMP_COVER
from ..confReader import TMP_DB, TMP_WEB, TMP_COVER, getStyleSheets
from ..version import VERSION
from ..perf.qtThreading import SyncWorker, InitDBWorker
import os, typing, requests, functools, time, shutil, traceback, webbrowser
Expand Down Expand Up @@ -717,6 +717,7 @@ def reloadData(self):
"""
Reload database,
Will synchronize add data if in online mode
by the way... realod stylesheet
"""
if getConf()["host"]:
try:
Expand All @@ -733,6 +734,13 @@ def reloadData(self):
# local dir
self.loadData_async(getConf()["database"], sync_after=False)
# self._loadData(getConf()["database"])
# reload stylesheet
# get application style, for development purpose
app: QApplication = QApplication.instance() # type: ignore
ss = getStyleSheets()[getConf()["stylesheet"]]
if ss != "":
with open(ss, "r", encoding="utf-8") as f:
app.setStyleSheet(f.read())

def statusBarMsg(self, msg: str, bg_color = "none"):
if self.db.offline:
Expand Down
2 changes: 1 addition & 1 deletion resbibman/assets/summary.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
html, body {
height: 100%;
margin: 0;
padding: 0;
padding: 10px;
font-family: "Times New Roman", Times, serif;
font-size: 1.2em;
margin-left: auto;
Expand Down
14 changes: 13 additions & 1 deletion resbibman/stylesheets/Simple-dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,17 @@ QTableView::item:hover:!selected {
background-color: #2f3a5b;
color: #cccccc;
border-style: solid;
border: 1px solid #D3F1FC;
}

QLineEdit, QTextEdit, QPlainTextEdit, QSpinBox, QDoubleSpinBox, QDateEdit, QTimeEdit, QDateTimeEdit {
background-color: #2e2e2e;
color: #f0f0f0;
border: 1px solid #4f4f4f;
border-radius: 5px;
padding: 2px;
}

QLineEdit:focus, QTextEdit:focus, QPlainTextEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QComboBox:focus, QDateEdit:focus, QTimeEdit:focus, QDateTimeEdit:focus {
border: 1px solid #7da0ff;
box-shadow: #222222 0px 0px 2px;
}

0 comments on commit 6d1754a

Please sign in to comment.