Skip to content

Commit

Permalink
Add a clutter end-session dialog. (#12519)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwebster authored Nov 27, 2024
1 parent 9e2d260 commit 66ad76e
Show file tree
Hide file tree
Showing 4 changed files with 459 additions and 0 deletions.
43 changes: 43 additions & 0 deletions data/theme/cinnamon-sass/widgets/_dialogs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,49 @@
}
}

// endSessionDialog.js
.end-session-dialog {
width: 40em;
transition-duration: 100ms;

.dialog-content-box {
spacing: $base_margin * 3;
width: 30em;
}

.end-session-dialog-inhibitor-list-frame {
background-color: $light_bg_color;
border-radius: $base_border_radius;
border: 1px solid $borders_color;
padding-left: 5px;
padding-right: 5px;
padding-top: 2px;
padding-bottom: 2px;
}

.end-session-dialog-inhibitor-list {
spacing-rows: 5px;
spacing-columns: 20px;
padding: 2px;
}

.end-session-dialog-inhibitor-list-reason {
width: 25em;
}

.end-session-dialog-progress-bar {
min-width: 160px;
-barlevel-height: 6px;
-barlevel-background-color: $base_color;
-barlevel-active-background-color: $fg_color;
-barlevel-amplify-color: $warning_color;
-barlevel-amplify-separator-width: $base_padding * 0.5;

&:ltr { margin-right: $base_padding; }
&:rtl { margin-left: $base_padding; }
}
}

// message dialog

.message-dialog-content {
Expand Down
15 changes: 15 additions & 0 deletions js/ui/cinnamonDBus.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ const CinnamonIface =
<arg type="a{sv}" direction="in" name="params"/> \
</method> \
<method name="HideMonitorLabels"/> \
<method name="ShowEndSessionDialog"> \
<arg type="i" direction="in" name="mode"/> \
</method> \
<method name="CloseEndSessionDialog"/> \
</interface> \
</node>';

Expand Down Expand Up @@ -515,5 +519,16 @@ CinnamonDBus.prototype = {
}
},

ShowEndSessionDialog(mode) {
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
Main.show_end_session_dialog(mode);
return GLib.SOURCE_REMOVE;
});
},

CloseEndSessionDialog() {
Main.close_end_session_dialog();
},

CinnamonVersion: Config.PACKAGE_VERSION
};
Loading

0 comments on commit 66ad76e

Please sign in to comment.