event-popover: Port to GTK4
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
#include "gcal-utils.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <handy.h>
|
||||
|
||||
struct _GcalEventPopover
|
||||
{
|
||||
@@ -416,7 +415,7 @@ add_meeting (GcalEventPopover *self,
|
||||
|
||||
row = gcal_meeting_row_new (url);
|
||||
g_signal_connect (row, "join-meeting", G_CALLBACK (on_join_meeting_cb), self);
|
||||
gtk_container_add (GTK_CONTAINER (self->meetings_listbox), row);
|
||||
gtk_list_box_append (self->meetings_listbox, row);
|
||||
|
||||
gtk_widget_show (GTK_WIDGET (self->meetings_listbox));
|
||||
}
|
||||
@@ -510,18 +509,12 @@ on_join_meeting_cb (GcalMeetingRow *meeting_row,
|
||||
const gchar *url,
|
||||
GcalEventPopover *self)
|
||||
{
|
||||
g_autoptr (GError) error = NULL;
|
||||
GtkWindow *window;
|
||||
|
||||
window = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self)));
|
||||
window = GTK_WINDOW (gtk_widget_get_native (GTK_WIDGET (self)));
|
||||
g_assert (window != NULL);
|
||||
|
||||
gtk_show_uri_on_window (window, url, GDK_CURRENT_TIME, &error);
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Error opening URL: %s", error->message);
|
||||
return;
|
||||
}
|
||||
gtk_show_uri (window, url, GDK_CURRENT_TIME);
|
||||
|
||||
/* For some reason, gtk_popover_popdown() crashes when called here */
|
||||
gtk_widget_hide (GTK_WIDGET (self));
|
||||
|
||||
@@ -8,46 +8,46 @@
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="spacing">0</property>
|
||||
<property name="spacing">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
<!-- Title -->
|
||||
<child>
|
||||
<object class="GtkLabel" id="summary_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">12</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<property name="width-chars">30</property>
|
||||
<property name="max-width-chars">40</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold" />
|
||||
</attributes>
|
||||
<style>
|
||||
<class name="title-3" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<!-- Date & Time -->
|
||||
<child>
|
||||
<object class="GtkLabel" id="date_time_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<style>
|
||||
<class name="dim-label" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="propagate-natural-width">True</property>
|
||||
<property name="propagate-natural-height">True</property>
|
||||
@@ -55,18 +55,19 @@
|
||||
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin">12</property>
|
||||
<property name="spacing">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
|
||||
<!-- Placeholder -->
|
||||
<child>
|
||||
<object class="GtkLabel" id="placeholder_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="label" translatable="yes">No event information</property>
|
||||
<attributes>
|
||||
<attribute name="style" value="italic" />
|
||||
@@ -80,6 +81,10 @@
|
||||
<!-- Description -->
|
||||
<child>
|
||||
<object class="GtkLabel" id="description_label">
|
||||
<property name="margin-top">12</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="use-markup">True</property>
|
||||
<property name="selectable">True</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
@@ -95,28 +100,30 @@
|
||||
<!-- Location -->
|
||||
<child>
|
||||
<object class="GtkBox" id="location_box">
|
||||
<property name="spacing">6</property>
|
||||
<property name="orientation">vertical</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="xalign">0.0</property>
|
||||
<property name="label" translatable="yes">Location</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold" />
|
||||
</attributes>
|
||||
<style>
|
||||
<class name="heading" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel" id="location_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="selectable">True</property>
|
||||
<property name="xalign">0.0</property>
|
||||
</object>
|
||||
@@ -137,16 +144,17 @@
|
||||
|
||||
<!-- Meetings -->
|
||||
<child>
|
||||
<object class="GtkSeparator">
|
||||
<property name="visible" bind-source="meetings_listbox" bind-property="visible" bind-flags="default|sync-create" />
|
||||
</object>
|
||||
<object class="GtkSeparator" />
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBox" id="meetings_listbox">
|
||||
<property name="visible">False</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<style>
|
||||
<class name="background" />
|
||||
<class name="calendar-list" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
@@ -155,8 +163,9 @@
|
||||
<!-- Edit button -->
|
||||
<child>
|
||||
<object class="GtkButton" id="edit_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-default">True</property>
|
||||
<property name="margin-bottom">12</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="margin-end">12</property>
|
||||
<property name="label" translatable="yes">Edit…</property>
|
||||
<signal name="clicked" handler="on_edit_button_clicked_cb" object="GcalEventPopover" swapped="no" />
|
||||
</object>
|
||||
|
||||
+1
-14
@@ -156,23 +156,10 @@ event.color-light:backdrop {
|
||||
|
||||
/* Event Popover */
|
||||
popover.event-popover,
|
||||
popover.event-popover > box {
|
||||
popover.event-popover > contents {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
popover.event-popover > box > button {
|
||||
border-left-width: 0;
|
||||
border-right-width: 0;
|
||||
border-bottom-width: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
popover.event-popover textview.view,
|
||||
popover.event-popover textview.view text {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.search-viewport {
|
||||
background-color: @theme_base_color;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user