Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions demo/Views/CSSView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,6 @@ public class CSSView : DemoPage {
card_box.append (card);
card_box.append (card_checkered);

var terminal_label = new Granite.HeaderLabel ("\"terminal\" style class");

var terminal = new Gtk.Label ("[ 73%] Linking C executable granite-demo\n[100%] Built target granite-demo") {
selectable = true,
wrap = true,
xalign = 0,
yalign = 0
};

var terminal_scroll = new Gtk.ScrolledWindow () {
min_content_height = 70,
child = terminal
};
terminal_scroll.add_css_class (Granite.STYLE_CLASS_TERMINAL);

var accent_color_label = new Granite.HeaderLabel ("Colored labels and icons");

var accent_color_box = new Gtk.Box (HORIZONTAL, 6);
Expand Down Expand Up @@ -139,8 +124,6 @@ public class CSSView : DemoPage {
};
box.append (card_header);
box.append (card_box);
box.append (terminal_label);
box.append (terminal_scroll);
box.append (accent_color_label);
box.append (accent_color_box);
box.append (success_color_box);
Expand Down
1 change: 1 addition & 0 deletions lib/Constants.vala
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ namespace Granite {
* When used with {@link Gtk.Label} this style includes internal padding. When used with {@link Gtk.TextView}
* interal padding will need to be set with {@link Gtk.Container.border_width}
*/
[Version (deprecated = true, deprecated_since = "9.0.0")]
public const string STYLE_CLASS_TERMINAL = "terminal";
/**
* Style class for title label text in a {@link Granite.MessageDialog}
Expand Down
18 changes: 18 additions & 0 deletions lib/Styles/Granite/_classes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,21 @@ paper {
font-family: monospace;
}

.terminal {
font-family: monospace;

background-color: $fg-color;
color: bg-color(0);

padding: rem(12px) rem(18px);

& selection {
background-color: bg-color(0);
color: $fg-color;

&:backdrop {
// Cancelling values set in non-terminal selection
background-color: inherit;
}
}
}
4 changes: 3 additions & 1 deletion lib/Widgets/MessageDialog.vala
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ public class Granite.MessageDialog : Granite.Dialog {
min_content_height = 70,
child = details_view
};
scroll_box.add_css_class (Granite.STYLE_CLASS_TERMINAL);
// This is an undocumented style in the Granite stylesheet, not
// intended to be used outside of a few system contexts
scroll_box.add_css_class ("terminal");

expander = new Gtk.Expander (_("Details")) {
child = scroll_box
Expand Down
Loading