[planner: 57/61] cell-renderer-popup: Use properties instead of GTK3 sealed struct members
- From: Mart Raudsepp <mraudsepp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner: 57/61] cell-renderer-popup: Use properties instead of GTK3 sealed struct members
- Date: Sat, 12 Jun 2021 17:30:29 +0000 (UTC)
commit 2bdcf2cbb8a7702b950b2220ad42b832efc3dfc2
Author: Mart Raudsepp <leio gentoo org>
Date: Sun Mar 21 09:45:12 2021 +0200
cell-renderer-popup: Use properties instead of GTK3 sealed struct members
This is now used only for rendering an editable date text into the cell
while doing date picking in PlannerCellRendererDate, but edits to it don't
affect anything and it's just confusing. Fix the pure GTK3 compatibility for
now, but later we should revisit this and either remove the text entry, or
make it work and modernize the cell renderer (or port to GTK4 GtkColumnView).
src/planner-cell-renderer-popup.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/planner-cell-renderer-popup.c b/src/planner-cell-renderer-popup.c
index 43f295a2..0f24ef8f 100644
--- a/src/planner-cell-renderer-popup.c
+++ b/src/planner-cell-renderer-popup.c
@@ -356,19 +356,21 @@ mcrp_start_editing (GtkCellRenderer *cell,
GtkCellRendererState flags)
{
PlannerCellRendererPopup *popup;
- GtkWidget *editable;
- gchar *text;
+ GtkWidget *editable;
+ gchar *text;
+ gboolean is_editable;
popup = PLANNER_CELL_RENDERER_POPUP (cell);
/* If the cell isn't editable we return NULL. */
- if (GTK_CELL_RENDERER_TEXT (popup)->editable == FALSE) {
+ g_object_get (popup, "editable", &is_editable, NULL);
+ if (!is_editable) {
return NULL;
}
editable = g_object_new (PLANNER_TYPE_POPUP_ENTRY, NULL);
- text = GTK_CELL_RENDERER_TEXT (cell)->text;
+ g_object_get (cell, "text", &text, NULL);
planner_popup_entry_set_text (PLANNER_POPUP_ENTRY (editable), text ? text : "");
g_object_set_data_full (G_OBJECT (editable),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]