Skip to content

Commit 61356a1

Browse files
Enhance UI: Implement frameless windows for dialogs and update styles for confirmation dialogs
1 parent 21be38f commit 61356a1

File tree

2 files changed

+109
-3
lines changed

2 files changed

+109
-3
lines changed

src/ui/dark_theme.qss

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ QWidget {
99
border: none; /* Remove default borders globally */
1010
}
1111

12+
/* Generic Dialog Fallback (frameless windows need a soft border) */
13+
QDialog {
14+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
15+
stop: 0 #2D2D2D, stop: 1 #272727);
16+
border: 1px solid #444A50; /* Subtle neutral border for all dialogs */
17+
border-radius: 10px;
18+
}
19+
1220
QMainWindow {
1321
background-color: #202020; /* Darkest background for the window frame */
1422
}
@@ -1232,6 +1240,82 @@ QDialog#lossyRotationDialog {
12321240
border-radius: 8px;
12331241
}
12341242

1243+
/* --- Delete Confirmation Dialog (custom QDialog) --- */
1244+
QDialog#deleteConfirmationDialog {
1245+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1246+
stop: 0 #2D2D2D, stop: 1 #272727);
1247+
border: 2px solid #DC3545; /* Danger accent */
1248+
border-radius: 12px;
1249+
}
1250+
1251+
QDialog#deleteConfirmationDialog QLabel#deleteDialogTitle {
1252+
color: #FF7A86;
1253+
font-weight: bold;
1254+
}
1255+
1256+
QDialog#deleteConfirmationDialog QLabel#deleteDialogInfo {
1257+
color: #C8C8C8;
1258+
}
1259+
1260+
QDialog#deleteConfirmationDialog QPushButton#deleteDialogCancelButton {
1261+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1262+
stop: 0 #383838, stop: 1 #303030);
1263+
color: #E0E0E0;
1264+
border: 1px solid #484848;
1265+
border-radius: 6px;
1266+
}
1267+
1268+
QDialog#deleteConfirmationDialog QPushButton#deleteDialogCancelButton:hover {
1269+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1270+
stop: 0 #454545, stop: 1 #3C3C3C);
1271+
color: #FFFFFF;
1272+
}
1273+
1274+
QDialog#deleteConfirmationDialog QPushButton#deleteDialogConfirmButton {
1275+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1276+
stop: 0 #DC3545, stop: 1 #B02A37);
1277+
color: #FFFFFF;
1278+
border: 1px solid #B02A37;
1279+
font-weight: bold;
1280+
border-radius: 6px;
1281+
}
1282+
1283+
QDialog#deleteConfirmationDialog QPushButton#deleteDialogConfirmButton:hover {
1284+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1285+
stop: 0 #E85362, stop: 1 #C73E4A);
1286+
}
1287+
1288+
/* --- Close Confirmation Dialog (custom QDialog) --- */
1289+
QDialog#closeConfirmationDialog {
1290+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1291+
stop: 0 #2D2D2D, stop: 1 #272727);
1292+
border: 2px solid #0084FF; /* Primary accent */
1293+
border-radius: 12px;
1294+
}
1295+
1296+
QDialog#closeConfirmationDialog QLabel#closeDialogTitle {
1297+
color: #0084FF;
1298+
font-weight: bold;
1299+
}
1300+
1301+
QDialog#closeConfirmationDialog QPushButton#closeDialogCancelButton,
1302+
QDialog#closeConfirmationDialog QPushButton#closeDialogIgnoreButton {
1303+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1304+
stop: 0 #383838, stop: 1 #303030);
1305+
color: #E0E0E0;
1306+
border: 1px solid #484848;
1307+
border-radius: 6px;
1308+
}
1309+
1310+
QDialog#closeConfirmationDialog QPushButton#closeDialogCommitButton {
1311+
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
1312+
stop: 0 #0084FF, stop: 1 #0066CC);
1313+
color: #FFFFFF;
1314+
border: 1px solid #005A9E;
1315+
border-radius: 6px;
1316+
font-weight: bold;
1317+
}
1318+
12351319
QLabel#lossyRotationMessageLabel {
12361320
color: #E5E5E5;
12371321
font-size: 11pt;
@@ -1308,14 +1392,14 @@ QPushButton#lossyRotationProceedButton:pressed {
13081392
background-color: #E67A35;
13091393
}
13101394

1311-
/* --- Confirm Delete Dialog (QMessageBox) --- */
1395+
/* --- Default Message Boxes --- */
13121396
QMessageBox {
13131397
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
13141398
stop: 0 #2D2D2D, stop: 1 #272727);
13151399
color: #E0E0E0;
13161400
font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
13171401
font-size: 9pt;
1318-
border: 2px solid #DC3545;
1402+
border: 2px solid #666C72; /* Neutral border for all QMessageBoxes */
13191403
border-radius: 12px;
13201404
}
13211405

src/ui/dialog_manager.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ def show_lossy_rotation_confirmation_dialog(
313313
dialog.setObjectName("lossyRotationDialog")
314314
dialog.setModal(True)
315315
dialog.setFixedSize(480, 200)
316+
# Frameless window for fancy UI
317+
dialog.setWindowFlags(dialog.windowFlags() | Qt.WindowType.FramelessWindowHint)
316318

317319
layout = QVBoxLayout(dialog)
318320
layout.setSpacing(20)
@@ -373,6 +375,8 @@ def show_cache_management_dialog(self):
373375
dialog = QDialog(self.parent)
374376
dialog.setWindowTitle("Cache Management")
375377
dialog.setObjectName("cacheManagementDialog")
378+
# Frameless window for fancy UI
379+
dialog.setWindowFlags(dialog.windowFlags() | Qt.WindowType.FramelessWindowHint)
376380
main_layout = QVBoxLayout(dialog)
377381
main_layout.setSpacing(15)
378382

@@ -553,6 +557,8 @@ def _show_delete_confirmation_dialog(
553557
dialog.setObjectName("deleteConfirmationDialog")
554558
dialog.setModal(True)
555559
dialog.setMinimumSize(600, 450)
560+
# Frameless window for fancy UI
561+
dialog.setWindowFlags(dialog.windowFlags() | Qt.WindowType.FramelessWindowHint)
556562

557563
layout = QVBoxLayout(dialog)
558564
layout.setContentsMargins(15, 15, 15, 15)
@@ -703,7 +709,19 @@ def show_potential_cache_overflow_warning(
703709
"Consider increasing the 'Preview Image Cache' size in "
704710
"Settings > Manage Cache for a smoother experience, or select a smaller folder."
705711
)
706-
QMessageBox.warning(self.parent, "Potential Cache Overflow", warning_msg)
712+
713+
# Replace static call with an instance to apply frameless styling
714+
warn_box = QMessageBox(self.parent)
715+
warn_box.setIcon(QMessageBox.Icon.Warning)
716+
warn_box.setWindowTitle("Potential Cache Overflow")
717+
warn_box.setText(warning_msg)
718+
warn_box.setStandardButtons(QMessageBox.StandardButton.Ok)
719+
warn_box.setDefaultButton(QMessageBox.StandardButton.Ok)
720+
# Frameless window for fancy UI
721+
warn_box.setWindowFlags(
722+
warn_box.windowFlags() | Qt.WindowType.FramelessWindowHint
723+
)
724+
warn_box.exec()
707725
logger.info("Closed potential cache overflow warning dialog")
708726

709727
def show_commit_deletions_dialog(self, marked_files: List[str]) -> bool:
@@ -801,6 +819,8 @@ def progress_callback(processed: int, total: int):
801819
dialog.setObjectName("closeConfirmationDialog")
802820
dialog.setModal(True)
803821
dialog.setMinimumSize(500, 300)
822+
# Frameless window for fancy UI
823+
dialog.setWindowFlags(dialog.windowFlags() | Qt.WindowType.FramelessWindowHint)
804824

805825
layout = QVBoxLayout(dialog)
806826
layout.setContentsMargins(20, 20, 20, 20)
@@ -924,6 +944,8 @@ def show_model_not_found_dialog(self, model_path: str):
924944
dialog = QMessageBox(self.parent)
925945
dialog.setWindowTitle("Rotation Model Not Found")
926946
dialog.setIcon(QMessageBox.Icon.Warning)
947+
# Frameless window for fancy UI
948+
dialog.setWindowFlags(dialog.windowFlags() | Qt.WindowType.FramelessWindowHint)
927949

928950
text = (
929951
f"The automatic rotation feature requires a model file that was not found at:\n"

0 commit comments

Comments
 (0)