utils: Add util function for selection widgetry

Will be used by the week grid
This commit is contained in:
Georges Basile Stavracas Neto
2025-03-19 19:23:57 -03:00
parent d7a6d95629
commit fe16da8ced
3 changed files with 63 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
/*
* gcal-gui-utils.c
*
* Copyright 2025 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* 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/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "gcal-gui-utils.h"
#include <adwaita.h>
GtkWidget*
gcal_create_selection_widget (void)
{
return g_object_new (ADW_TYPE_BIN,
"css-name", "selection",
NULL);
}
+30
View File
@@ -0,0 +1,30 @@
/*
* gcal-gui-utils.h
*
* Copyright 2025 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
*
* 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/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <gtk/gtk.h>
G_BEGIN_DECLS
GtkWidget* gcal_create_selection_widget (void);
G_END_DECLS
+1
View File
@@ -2,6 +2,7 @@ calendar_incs += include_directories('.')
sources += files(
'gcal-date-time-utils.c',
'gcal-gui-utils.c',
'gcal-source-discoverer.c',
'gcal-utils.c',
)