Remove Card class and rename CardArea<T> to ListView<T>

This commit is contained in:
Camden Dixie O'Brien 2025-03-03 09:31:43 +00:00
parent b2f5288c4b
commit 5697cf0652
4 changed files with 9 additions and 14 deletions

View File

@ -1,5 +1,5 @@
namespace StudySystemClient { namespace StudySystemClient {
public class ActivitiesView : CardArea<ActivityCard>, IRefreshable { public class ActivitiesView : ListView<ActivityCard>, IRefreshable {
private const uint REFRESH_PERIOD_MS = 30000; private const uint REFRESH_PERIOD_MS = 30000;
private Client client; private Client client;
@ -7,6 +7,8 @@ namespace StudySystemClient {
private bool pending_sort; private bool pending_sort;
public ActivitiesView(Client client) { public ActivitiesView(Client client) {
base();
add_css_class("card-container");
this.client = client; this.client = client;
refresher = new Refresher(this, REFRESH_PERIOD_MS); refresher = new Refresher(this, REFRESH_PERIOD_MS);
pending_sort = false; pending_sort = false;

View File

@ -1,5 +1,5 @@
namespace StudySystemClient { namespace StudySystemClient {
public class ActivityCard : Card { public class ActivityCard : Gtk.Frame {
public signal void session_logged(string subject, ActivityType type, public signal void session_logged(string subject, ActivityType type,
int minutes); int minutes);
public signal void log_closed(); public signal void log_closed();
@ -10,7 +10,8 @@ namespace StudySystemClient {
private Gtk.Label priority_label; private Gtk.Label priority_label;
public ActivityCard(Activity activity) { public ActivityCard(Activity activity) {
base(); hexpand = true;
add_css_class("card");
this.activity = activity; this.activity = activity;
logging = false; logging = false;

View File

@ -1,15 +1,8 @@
namespace StudySystemClient { namespace StudySystemClient {
public class Card : Gtk.Frame { public class ListView<T> : Gtk.Box {
public Card() {
hexpand = true;
add_css_class("card");
}
}
public class CardArea<T> : Gtk.Box {
protected IterableBox<T> container; protected IterableBox<T> container;
public CardArea() { public ListView() {
hexpand = vexpand = true; hexpand = vexpand = true;
margin_top = margin_bottom = margin_start = margin_end = 0; margin_top = margin_bottom = margin_start = margin_end = 0;
@ -19,7 +12,6 @@ namespace StudySystemClient {
var scrolled_window = new Gtk.ScrolledWindow(); var scrolled_window = new Gtk.ScrolledWindow();
scrolled_window.hscrollbar_policy = Gtk.PolicyType.NEVER; scrolled_window.hscrollbar_policy = Gtk.PolicyType.NEVER;
scrolled_window.hexpand = scrolled_window.vexpand = true; scrolled_window.hexpand = scrolled_window.vexpand = true;
scrolled_window.add_css_class("card-container");
scrolled_window.set_child(container); scrolled_window.set_child(container);
append(scrolled_window); append(scrolled_window);

View File

@ -13,11 +13,11 @@ lib = library(
'activities_view.vala', 'activities_view.vala',
'activity.vala', 'activity.vala',
'activity_card.vala', 'activity_card.vala',
'card.vala',
'client.vala', 'client.vala',
'connection.vala', 'connection.vala',
'der.vala', 'der.vala',
'iterable_box.vala', 'iterable_box.vala',
'list_view.vala',
'main_window.vala', 'main_window.vala',
'periodic.vala', 'periodic.vala',
'refresher.vala', 'refresher.vala',