-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8ddfe5
commit 9509f1b
Showing
5 changed files
with
96 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* SPDX-License-Identifier: GPL-3.0-or-later | ||
* SPDX-FileCopyrightText: 2024 elementary, Inc. (https://elementary.io) | ||
*/ | ||
|
||
public class DescriptionRow : Gtk.Box { | ||
public string description { get; construct; } | ||
public string icon_name { get; construct; } | ||
public string color { get; construct; } | ||
|
||
public DescriptionRow (string description, string icon_name, string color) { | ||
Object ( | ||
color: color, | ||
description: description, | ||
icon_name: icon_name | ||
); | ||
} | ||
|
||
construct { | ||
var image = new Gtk.Image.from_icon_name (icon_name, LARGE_TOOLBAR) { | ||
pixel_size = 24, | ||
valign = START | ||
}; | ||
image.get_style_context ().add_class (Granite.STYLE_CLASS_ACCENT); | ||
image.get_style_context ().add_class (color); | ||
|
||
var description_label = new Gtk.Label (description) { | ||
hexpand = true, | ||
max_width_chars = 1, // Make Gtk wrap, but not expand the window | ||
use_markup = true, | ||
wrap = true, | ||
xalign = 0 | ||
}; | ||
|
||
spacing = 12; | ||
add (image); | ||
add (description_label); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters