event-editor/notes-section: Port to GTK4
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
struct _GcalNotesSection
|
struct _GcalNotesSection
|
||||||
{
|
{
|
||||||
GtkBin parent;
|
AdwBin parent;
|
||||||
|
|
||||||
GtkTextView *notes_text;
|
GtkTextView *notes_text;
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ struct _GcalNotesSection
|
|||||||
|
|
||||||
static void gcal_event_editor_section_iface_init (GcalEventEditorSectionInterface *iface);
|
static void gcal_event_editor_section_iface_init (GcalEventEditorSectionInterface *iface);
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GcalNotesSection, gcal_notes_section, GTK_TYPE_BIN,
|
G_DEFINE_TYPE_WITH_CODE (GcalNotesSection, gcal_notes_section, ADW_TYPE_BIN,
|
||||||
G_IMPLEMENT_INTERFACE (GCAL_TYPE_EVENT_EDITOR_SECTION, gcal_event_editor_section_iface_init))
|
G_IMPLEMENT_INTERFACE (GCAL_TYPE_EVENT_EDITOR_SECTION, gcal_event_editor_section_iface_init))
|
||||||
|
|
||||||
enum
|
enum
|
||||||
@@ -177,4 +177,6 @@ static void
|
|||||||
gcal_notes_section_init (GcalNotesSection *self)
|
gcal_notes_section_init (GcalNotesSection *self)
|
||||||
{
|
{
|
||||||
gtk_widget_init_template (GTK_WIDGET (self));
|
gtk_widget_init_template (GTK_WIDGET (self));
|
||||||
|
|
||||||
|
gtk_widget_remove_css_class (GTK_WIDGET (self->notes_text), "view");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,11 +20,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <adwaita.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GCAL_TYPE_NOTES_SECTION (gcal_notes_section_get_type())
|
#define GCAL_TYPE_NOTES_SECTION (gcal_notes_section_get_type())
|
||||||
G_DECLARE_FINAL_TYPE (GcalNotesSection, gcal_notes_section, GCAL, NOTES_SECTION, GtkBin)
|
G_DECLARE_FINAL_TYPE (GcalNotesSection, gcal_notes_section, GCAL, NOTES_SECTION, AdwBin)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|||||||
@@ -1,23 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<template class="GcalNotesSection" parent="GtkBin">
|
<template class="GcalNotesSection" parent="AdwBin">
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<style>
|
<style>
|
||||||
<class name="notes-section" />
|
<class name="notes-section" />
|
||||||
|
<class name="card" />
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
|
||||||
<style>
|
|
||||||
<class name="frame" />
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTextView" id="notes_text">
|
<object class="GtkTextView" id="notes_text">
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="top_margin">6</property>
|
<property name="top_margin">6</property>
|
||||||
<property name="bottom_margin">6</property>
|
<property name="bottom_margin">6</property>
|
||||||
|
|||||||
@@ -499,17 +499,11 @@ monthpopover > box {
|
|||||||
background: @theme_bg_color;
|
background: @theme_bg_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes-section .frame {
|
.notes-section box > textview {
|
||||||
border-radius: 8px;
|
|
||||||
-gtk-outline-radius: 7px;
|
|
||||||
border-color: alpha(@borders, 0.7);
|
|
||||||
}
|
|
||||||
|
|
||||||
.notes-section .frame > textview.view {
|
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notes-section .frame > textview.view > text {
|
.notes-section box > textview > text {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user