Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 545236f

Browse files
committedMay 19, 2024·
Merge branch 'unique-content-containers' of github.com:TheWiseNoob/OMP into unique-content-containers
2 parents 58c4422 + f2b6342 commit 545236f

File tree

8 files changed

+26
-5
lines changed

8 files changed

+26
-5
lines changed
 

‎src/content.c

+7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
#include "app.h"
77
#include "appwin.h"
88
#include "sidebar.h"
9+
#include "panels/context/context-panel.h"
910

1011
#include "taglib/tag_c.h"
1112

1213
struct _OMPContent {
1314
AdwBin parent;
1415

1516
GtkWidget* content_label;
17+
GtkWidget* context_container;
1618
GtkWidget* open_sidebar_overlay_button;
1719
GtkWidget* tag_label;
1820
};
@@ -125,6 +127,8 @@ omp_content_show_sidebar (OMPSidebar* sidebar, OMPContent* content)
125127
static void
126128
omp_content_init (OMPContent* content)
127129
{
130+
g_type_ensure (OMP_CONTEXT_PANEL_TYPE);
131+
128132
gtk_widget_init_template (GTK_WIDGET (content));
129133

130134
omp_app_set_content (OMP_APP (g_application_get_default ()), content);
@@ -181,6 +185,9 @@ omp_content_class_init (OMPContentClass* self)
181185
gtk_widget_class_bind_template_child (
182186
GTK_WIDGET_CLASS (self), OMPContent, tag_label
183187
);
188+
gtk_widget_class_bind_template_child (
189+
GTK_WIDGET_CLASS (self), OMPContent, context_container
190+
);
184191

185192
// Callbacks
186193
gtk_widget_class_bind_template_callback (

‎src/panels/context/context-panel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ omp_context_panel_class_init (OMPContextPanelClass* klass)
1515

1616
gtk_widget_class_set_template_from_resource (
1717
widget_class,
18-
"/org/gnome/control-center/bluetooth/cc-bluetooth-panel.ui"
18+
"/com/openmusicplayer/omp/ui/context.ui"
1919
);
2020
}
2121

‎src/panels/context/context-panel.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
G_BEGIN_DECLS
77

8-
#define OMP_TYPE_CONTEXT_PANEL (omp_context_panel_get_type ())
8+
#define OMP_CONTEXT_PANEL_TYPE (omp_context_panel_get_type ())
99
G_DECLARE_FINAL_TYPE (
10-
OMPContextPanel, omp_context_panel, OMP, CONTEXT_PANEL, AdwBin
10+
OMPContextPanel, omp_context_panel, OMP, APP_CONTEXT_PANEL, AdwBin
1111
)
1212

1313
G_END_DECLS

‎src/panels/context/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
context_sources = [
2-
'context-panel.c',
2+
'context-panel.c',
33
]
44

55
foreach context_source: context_sources
6-
sources += 'panels/context/' + context_source
6+
sources += 'panels/context/' + context_source
77
endforeach

‎src/resources/omp.gresource.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<gresources>
33
<gresource prefix="/com/openmusicplayer/omp">
4+
<file preprocess="xml-stripblanks">ui/context.ui</file>
45
<file preprocess="xml-stripblanks">ui/content.ui</file>
56
<file preprocess="xml-stripblanks">ui/sidebar.ui</file>
67
<file preprocess="xml-stripblanks">ui/window.ui</file>

‎src/resources/ui/content.blp

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ template $OMPContent : Adw.Bin {
3939
};
4040
}
4141

42+
[end]
43+
$OMPContextPanel context_container {
44+
}
45+
4246
[end]
4347
Label tag_label {
4448
label: "";

‎src/resources/ui/context.blp

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Gtk 4.0;
2+
using Adw 1;
3+
4+
template $OMPContextPanel : Adw.Bin {
5+
Gtk.Label {
6+
label: 'Herpa';
7+
}
8+
}

‎src/resources/ui/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
blueprints = custom_target('blueprints',
22
input: files(
3+
'context.blp',
34
'content.blp',
45
'sidebar.blp',
56
'window.blp'

0 commit comments

Comments
 (0)
Please sign in to comment.