Commit 591148f2 authored by Zander's avatar Zander 💥

Update wallpaper styling

Fixed #7
parent 3b46a2b0
Pipeline #68060 passed with stage
in 1 minute and 37 seconds
......@@ -7,6 +7,20 @@ namespace IconPreview {
COLOUR
}
// Adapted from one of the gtk demos
public void apply_css(Widget widget, CssProvider provider) {
var context = widget.get_style_context();
StyleProvider existing = widget.get_data("it-style-provider");
if (existing != null) {
context.remove_provider(existing);
}
context.add_provider(provider, uint.MAX - 10);
widget.set_data("it-style-provider", provider);
if (widget is Container) {
(widget as Container).forall(child => apply_css(child, provider));
}
}
public interface Previewer : Widget {
public abstract File previewing { get; set; }
public abstract Exporter exporter { owned get; }
......@@ -45,16 +59,22 @@ namespace IconPreview {
public void about (Gtk.Window parent) {
var authors = new string[] {"Zander Brown", "Bilal Elmoussaoui"};
var artists = new string[] {"Tobias Bernard"};
show_about_dialog (parent,
program_name: _("Icon Preview"),
logo_icon_name: "org.gnome.IconPreview",
version: PACKAGE_VERSION,
copyright: _("Copyright © 2018 Zander Brown"),
license_type: License.GPL_3_0,
authors: authors,
artists: artists,
website: "https://gitlab.gnome.org/ZanderBrown/icon-tool/",
website_label: _("Repository"));
var helpers = new string[] {"Jordan Petridis"};
var dlg = new AboutDialog () {
transient_for = parent,
modal = true,
program_name = _("Icon Preview"),
logo_icon_name = "org.gnome.IconPreview",
version = PACKAGE_VERSION,
copyright = _("Copyright © 2018 Zander Brown"),
license_type = GPL_3_0,
authors = authors,
artists = artists,
website = "https://gitlab.gnome.org/ZanderBrown/icon-tool/",
website_label = _("Repository")
};
dlg.add_credit_section(_("Kept sane by"), helpers);
dlg.show();
}
// Handler for app.palette
......
......@@ -25,10 +25,20 @@ colour-view grid.larger {
margin-top: 10px;
}
colour-view .wallpaper .backdrop {
background: rgba(0, 0, 0, 0.25);
}
colour-view .wallpaper {
/* Try again with gtk4 background-size: cover; */
background-position: center;
background-image: url('resource://org/gnome/IconPreview/wallpapers/Adwaita.jpg');
color: white;
text-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 1px 8px rgba(0,0,0,0.2);
}
colour-view .wallpaper label:backdrop {
color: white;
}
.theme-Adwaita-dark .wallpaper {
......@@ -68,6 +78,10 @@ demo-icon {
border-bottom: 1px solid @borders;
}
.palette button:hover {
border: 1px solid @theme_selected_bg_color;
}
.palette button:first-child {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
......
......@@ -110,23 +110,57 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkBox" id="small">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
<object class="GtkBox" id="small">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkBox" id="grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
......@@ -135,30 +169,12 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<style>
<class name="backdrop"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
......
......@@ -16,6 +16,7 @@ namespace IconPreview {
orientation = VERTICAL;
spacing = 5;
expand = false;
valign = CENTER;
label.ellipsize = MIDDLE;
label.max_width_chars = 30;
......@@ -71,7 +72,7 @@ namespace IconPreview {
} else {
provider = CssProvider.get_named(_theme, null);
}
apply_css(this);
apply_css(this, provider);
}
}
......@@ -124,20 +125,6 @@ namespace IconPreview {
theme = theme;
}
// Adapted from one of the gtk demos
private void apply_css(Widget widget) {
var context = widget.get_style_context();
StyleProvider existing = widget.get_data("pane-style-provider");
if (existing != null) {
context.remove_provider(existing);
}
context.add_provider(provider, uint.MAX - 10);
widget.set_data("pane-style-provider", provider);
if (widget is Container) {
(widget as Container).forall(apply_css);
}
}
public void load_samples (Icon[] samples) requires (samples.length == randoms.length()) {
// Don't like how much of this is hardcoded
var idx = 0;
......
......@@ -44,7 +44,7 @@ namespace IconPreview {
} else {
provider = CssProvider.get_named(_theme, null);
}
apply_css(this);
apply_css(this, provider);
}
}
......@@ -72,20 +72,6 @@ namespace IconPreview {
theme = theme;
}
// Adapted from one of the gtk demos
private void apply_css(Widget widget) {
var context = widget.get_style_context();
StyleProvider existing = widget.get_data("pane-style-provider");
if (existing != null) {
context.remove_provider(existing);
}
context.add_provider(provider, uint.MAX - 10);
widget.set_data("pane-style-provider", provider);
if (widget is Container) {
(widget as Container).forall(apply_css);
}
}
public void load_samples (Icon[] samples) /*requires (samples.length == 20)*/ {
// Vala seems to have some kinda bug with requires here
return_if_fail(samples.length == 20);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment