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