Skip to content
Closed
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
19 changes: 18 additions & 1 deletion src/Views/UpdateView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,27 @@ public class Onboarding.UpdateView : AbstractOnboardingView {
public UpdateView () {
Object (
view_name: "update",
description: _("Continue to set up some useful new features. For more detailed information about updates, check out <a href='https://blog.elementary.io'>our blog</a>."),
description: _("Continue to set up some useful new features. For more detailed information about updates or how to support development, check out the links below."),
icon_name: Utils.logo_icon_name,
badge_name: "system-software-update",
title: _("What’s New")
);
}

construct {
var blog_link = new ImageLinkButton (
"https://blog.elementary.io",
_("Read our blog…"),
"text-x-generic-symbolic"
);

var getinvolved_link = new ImageLinkButton (
"https://elementary.io/get-involved",
_("Get Involved…"),
"applications-development-symbolic"
);

custom_bin.attach (blog_link, 0, 0);
custom_bin.attach (getinvolved_link, 0, 1);
}
}
26 changes: 0 additions & 26 deletions src/Views/WelcomeView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,4 @@ public class Onboarding.WelcomeView : AbstractOnboardingView {
custom_bin.attach (support_link, 0, 1);
custom_bin.attach (getinvolved_link, 0, 2);
}

private class ImageLinkButton : Gtk.LinkButton {
public string icon_name { get; construct; }
public string label_string { get; construct; }

public ImageLinkButton (string uri, string label_string, string icon_name) {
Object (
uri: uri,
label_string: label_string,
icon_name: icon_name
);
}

construct {
var image = new Gtk.Image.from_icon_name (icon_name, Gtk.IconSize.MENU);

var left_label = new Gtk.Label (label_string);
left_label.xalign = 0;

var grid = new Gtk.Grid ();
grid.add (image);
grid.add (left_label);

add (grid);
}
}
}
43 changes: 43 additions & 0 deletions src/Widgets/ImageLinkButton.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*-
* Copyright (c) 2020 elementary, Inc. (https://elementary.io)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


public class Onboarding.ImageLinkButton : Gtk.LinkButton {
public string icon_name { get; construct; }
public string label_string { get; construct; }

public ImageLinkButton (string uri, string label_string, string icon_name) {
Object (
uri: uri,
label_string: label_string,
icon_name: icon_name
);
}

construct {
var image = new Gtk.Image.from_icon_name (icon_name, Gtk.IconSize.MENU);

var left_label = new Gtk.Label (label_string);
left_label.xalign = 0;

var grid = new Gtk.Grid ();
grid.add (image);
grid.add (left_label);

add (grid);
}
}
1 change: 1 addition & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ vala_files = [
'Views/StyleView.vala',
'Views/UpdateView.vala',
'Views/WelcomeView.vala',
'Widgets/ImageLinkButton.vala',
]

config_data = configuration_data()
Expand Down