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
2 changes: 2 additions & 0 deletions files/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ install_subdir(
'usr' / 'bin',
install_dir: bindir,
strip_directory: true,
follow_symlinks: true,
)

install_subdir(
'usr' / 'share',
install_dir: prefix,
follow_symlinks: true,
Comment thread
leigh123linux marked this conversation as resolved.
Comment thread
leigh123linux marked this conversation as resolved.
)
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('slick-greeter', 'vala', 'c', version : '2.2.6', meson_version : '>= 0.49.0')
project('slick-greeter', 'vala', 'c', version : '2.2.6', meson_version : '>= 1.3.0')

cc = meson.get_compiler('c')

Expand Down
6 changes: 3 additions & 3 deletions src/animate-timer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private class AnimateTimer : Object
public const int SLOW = 1000; /* Good for animations that convey information that is only presented in the animation */

/* speed is in milliseconds */
public unowned EasingFunc easing_func { get; private set; }
private unowned EasingFunc _easing_func;
public int speed { get; set; }
public bool is_running { get { return timeout != 0; } }
public double progress { get; private set; }
Expand All @@ -55,7 +55,7 @@ private class AnimateTimer : Object
public AnimateTimer (EasingFunc func, int speed)
{
Object (speed: speed);
this.easing_func = func;
this._easing_func = func;
}

~AnimateTimer ()
Expand Down Expand Up @@ -124,7 +124,7 @@ private class AnimateTimer : Object
time is not normalized yet! */
private double calculate_progress (double time_progress)
{
var y = easing_func (time_progress);
var y = _easing_func (time_progress);
return y.clamp (0.0, 1.0);
}

Expand Down
34 changes: 14 additions & 20 deletions src/dash-box.vala
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ public class DashBox : Gtk.Box
force_immediate_layout_update ();
rebuild_background ();
break;
case Mode.NORMAL:
break;
}
}

Expand Down Expand Up @@ -270,28 +272,20 @@ public class DashBox : Gtk.Box
{
if (width > 0 && height > 0)
{
try
{
bg_surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, width, height);
var bg_cr = new Cairo.Context (bg_surface);
// Draw background in temporary surface
if (background != null)
{
int x, y;
background.translate_coordinates (this, 0, 0, out x, out y);
bg_cr.save ();
bg_cr.translate (x, y);
background.draw_full (bg_cr, Background.DrawFlags.NONE);
bg_cr.restore ();
}
// Apply blur effect
CairoUtils.ExponentialBlur.surface (bg_surface, BLUR_RADIUS);
}
catch (Error e)
bg_surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, width, height);
var bg_cr = new Cairo.Context (bg_surface);
// Draw background in temporary surface
if (background != null)
{
warning ("Failed to create background surface: %s", e.message);
bg_surface = null;
int x, y;
background.translate_coordinates (this, 0, 0, out x, out y);
bg_cr.save ();
bg_cr.translate (x, y);
background.draw_full (bg_cr, Background.DrawFlags.NONE);
bg_cr.restore ();
}
// Apply blur effect
CairoUtils.ExponentialBlur.surface (bg_surface, BLUR_RADIUS);
}
}

Expand Down
13 changes: 11 additions & 2 deletions src/dash-entry.vala
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,19 @@
}
}

override_font (Pango.FontDescription.from_string (font));

var style_ctx = get_style_context ();

try
{
var font_provider = new Gtk.CssProvider ();
font_provider.load_from_data ("entry { font-family: Ubuntu; font-size: 14pt; }", -1);
style_ctx.add_provider (font_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
Comment on lines 74 to +81
catch (Error e)
Comment on lines +78 to +82
{
debug ("Internal error loading font style: %s", e.message);
}

try
{
var padding_provider = new Gtk.CssProvider ();
Expand Down Expand Up @@ -285,7 +294,7 @@

public override bool key_press_event (Gdk.EventKey event)
{
// This is a workaroud for bug https://launchpad.net/bugs/944159

Check failure on line 297 in src/dash-entry.vala

View workflow job for this annotation

GitHub Actions / build / build (mint22, linuxmintd/mint22.3-amd64, Mint 22, true) / Mint 22

workaroud ==> workaround
// The problem is that orca seems to not notice that it's in a password
// field on startup. We just need to kick orca in the pants.
if (SlickGreeter.singleton.orca_needs_kick)
Expand Down
3 changes: 2 additions & 1 deletion src/idle-monitor.vala
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public class IdleMonitor
warning ("Only support idle monitor under X");
return;
}
display = (d as Gdk.X11.Display).get_xdisplay ();
var x11_display = (Gdk.X11.Display) d;
display = x11_display.get_xdisplay ();

int sync_error_base;
var res = X.Sync.QueryExtension (display, out sync_event_base, out sync_error_base);
Expand Down
6 changes: 5 additions & 1 deletion src/list-stack.vala
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ public class ListStack : Gtk.Fixed

unowned List<weak Gtk.Widget> prev = children.last ().prev;
if (prev != null)
(prev.data as GreeterList).greeter_box.pop ();
{
var prev_list = prev.data as GreeterList;
if (prev_list != null)
prev_list.greeter_box.pop ();
}
}

public override void size_allocate (Gtk.Allocation allocation)
Expand Down
82 changes: 45 additions & 37 deletions src/main-window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,22 @@
add_accel_group (accel_group);

var bg_color = Gdk.RGBA ();
set_name ("main-window");
bg_color.parse (UGSettings.get_string (UGSettings.KEY_BACKGROUND_COLOR));
override_background_color (Gtk.StateFlags.NORMAL, bg_color);
try
{
var bg_provider = new Gtk.CssProvider ();
bg_provider.load_from_data (
"#main-window { background-color: %s; }".printf (bg_color.to_string ()), -1);
get_style_context ().add_provider (bg_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
catch (Error e)
{
debug ("Internal error setting background color: %s", e.message);
}
get_accessible ().set_name (_("Login Screen"));
has_resize_grip = false;
/* has_resize_grip = false — removed, deprecated since GTK 3.14 */
SlickGreeter.add_style_class (this);

background = new Background ();
Expand All @@ -64,11 +76,10 @@

/* Box for menubar shadow */
var menubox = new Gtk.EventBox ();
var menualign = new Gtk.Alignment (0.0f, 0.0f, 1.0f, 0.0f);
var shadow_path = Path.build_filename (Config.PKGDATADIR,
"shadow.png", null);
var shadow_style = "";
if (FileUtils.test (shadow_path, FileTest.EXISTS))

Check failure on line 82 in src/main-window.vala

View workflow job for this annotation

GitHub Actions / build / build (mint22, linuxmintd/mint22.3-amd64, Mint 22, true) / Mint 22

FileTest ==> file test
{
shadow_style = "background-image: url('%s');background-repeat: repeat;".printf(shadow_path);
}
Expand All @@ -86,15 +97,13 @@
}
menubox.set_size_request (-1, MENUBAR_HEIGHT);
menubox.show ();
menualign.show ();
menubox.add (menualign);
login_box.add (menubox);
SlickGreeter.add_style_class (menualign);
SlickGreeter.add_style_class (menubox);

menubar = new MenuBar (background, accel_group, this);
menubar.hexpand = true;
menubar.show ();
menualign.add (menubar);
menubox.add (menubar);
SlickGreeter.add_style_class (menubar);

content_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
Expand All @@ -103,40 +112,34 @@
login_box.add (content_box);

var content_align = UGSettings.get_string(UGSettings.KEY_CONTENT_ALIGN);
var x_align = 0.5f;

hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
hbox.vexpand = true;
if (content_align == "left")
{
x_align = 0.0f;
}
hbox.halign = Gtk.Align.START;
else if (content_align == "right")
{
x_align = 1.0f;
}

var align = new Gtk.Alignment (x_align, 0.0f, 0.0f, 1.0f);
hbox.halign = Gtk.Align.END;
else
hbox.halign = Gtk.Align.CENTER;

if (content_align == "center")
{
// offset for back button
align.margin_right = grid_size;
hbox.margin_end = grid_size;
}

align.show ();
content_box.add (align);

hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
hbox.expand = true;
hbox.show ();
align.add (hbox);
content_box.add (hbox);

align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);
var back_align = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
// Hack to avoid gtk 3.20's new allocate logic, which messes us up.
align.resize_mode = Gtk.ResizeMode.QUEUE;
align.set_size_request (grid_size, -1);
align.margin_bottom = MENUBAR_HEIGHT; /* offset for menubar at top */
align.show ();
hbox.add (align);
back_align.resize_mode = Gtk.ResizeMode.QUEUE;
back_align.set_size_request (grid_size, -1);
back_align.margin_bottom = MENUBAR_HEIGHT;
back_align.halign = Gtk.Align.CENTER;
back_align.valign = Gtk.Align.CENTER;
back_align.show ();
hbox.add (back_align);

back_button = new FlatButton ();
back_button.get_accessible ().set_name (_("Back"));
Expand All @@ -146,15 +149,20 @@
back_button.set_size_request (grid_size - GreeterList.BORDER * 2, grid_size - GreeterList.BORDER * 2);
back_button.add (image);
back_button.clicked.connect (pop_list);
align.add (back_button);
back_align.add (back_button);

align = new Gtk.Alignment (0.0f, 0.5f, 0.0f, 1.0f);
align.show ();
hbox.add (align);
var stack_align = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
stack_align.halign = Gtk.Align.START;
stack_align.valign = Gtk.Align.FILL;
stack_align.vexpand = true;
stack_align.show ();
hbox.add (stack_align);

stack = new ListStack ();
stack.valign = Gtk.Align.FILL;
stack.vexpand = true;
stack.show ();
align.add (stack);
stack_align.add (stack);

add_user_list ();

Expand Down Expand Up @@ -216,8 +224,8 @@
if (content_box != null)
{
var content_align = UGSettings.get_string(UGSettings.KEY_CONTENT_ALIGN);
content_box.margin_left = get_grid_offset (get_allocated_width ()) + (content_align == "left" ? grid_size : 0);
content_box.margin_right = get_grid_offset (get_allocated_width ()) + (content_align == "right" ? grid_size : 0);
content_box.margin_start = get_grid_offset (get_allocated_width ()) + (content_align == "left" ? grid_size : 0);
content_box.margin_end = get_grid_offset (get_allocated_width ()) + (content_align == "right" ? grid_size : 0);
content_box.margin_top = get_grid_offset (get_allocated_height ());
content_box.margin_bottom = get_grid_offset (get_allocated_height ());
}
Expand All @@ -226,7 +234,7 @@
public override void realize ()
{
base.realize ();
background.set_surface (Gdk.cairo_create (get_window ()).get_target ());
background.set_surface (get_window ().create_similar_surface (Cairo.Content.COLOR, 1, 1));
}

public void before_session_start()
Expand Down
Loading
Loading