Skip to content

Commit

Permalink
Merge branch 'unique-content-containers' of github.com:TheWiseNoob/OM…
Browse files Browse the repository at this point in the history
…P into unique-content-containers
  • Loading branch information
TheWiseNoob committed May 19, 2024
2 parents 58c4422 + f2b6342 commit 545236f
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/content.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
#include "app.h"
#include "appwin.h"
#include "sidebar.h"
#include "panels/context/context-panel.h"

#include "taglib/tag_c.h"

struct _OMPContent {
AdwBin parent;

GtkWidget* content_label;
GtkWidget* context_container;
GtkWidget* open_sidebar_overlay_button;
GtkWidget* tag_label;
};
Expand Down Expand Up @@ -125,6 +127,8 @@ omp_content_show_sidebar (OMPSidebar* sidebar, OMPContent* content)
static void
omp_content_init (OMPContent* content)
{
g_type_ensure (OMP_CONTEXT_PANEL_TYPE);

gtk_widget_init_template (GTK_WIDGET (content));

omp_app_set_content (OMP_APP (g_application_get_default ()), content);
Expand Down Expand Up @@ -181,6 +185,9 @@ omp_content_class_init (OMPContentClass* self)
gtk_widget_class_bind_template_child (
GTK_WIDGET_CLASS (self), OMPContent, tag_label
);
gtk_widget_class_bind_template_child (
GTK_WIDGET_CLASS (self), OMPContent, context_container
);

// Callbacks
gtk_widget_class_bind_template_callback (
Expand Down
2 changes: 1 addition & 1 deletion src/panels/context/context-panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ omp_context_panel_class_init (OMPContextPanelClass* klass)

gtk_widget_class_set_template_from_resource (
widget_class,
"/org/gnome/control-center/bluetooth/cc-bluetooth-panel.ui"
"/com/openmusicplayer/omp/ui/context.ui"
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/panels/context/context-panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

G_BEGIN_DECLS

#define OMP_TYPE_CONTEXT_PANEL (omp_context_panel_get_type ())
#define OMP_CONTEXT_PANEL_TYPE (omp_context_panel_get_type ())
G_DECLARE_FINAL_TYPE (
OMPContextPanel, omp_context_panel, OMP, CONTEXT_PANEL, AdwBin
OMPContextPanel, omp_context_panel, OMP, APP_CONTEXT_PANEL, AdwBin
)

G_END_DECLS
4 changes: 2 additions & 2 deletions src/panels/context/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
context_sources = [
'context-panel.c',
'context-panel.c',
]

foreach context_source: context_sources
sources += 'panels/context/' + context_source
sources += 'panels/context/' + context_source
endforeach
1 change: 1 addition & 0 deletions src/resources/omp.gresource.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/com/openmusicplayer/omp">
<file preprocess="xml-stripblanks">ui/context.ui</file>
<file preprocess="xml-stripblanks">ui/content.ui</file>
<file preprocess="xml-stripblanks">ui/sidebar.ui</file>
<file preprocess="xml-stripblanks">ui/window.ui</file>
Expand Down
4 changes: 4 additions & 0 deletions src/resources/ui/content.blp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ template $OMPContent : Adw.Bin {
};
}

[end]
$OMPContextPanel context_container {
}

[end]
Label tag_label {
label: "";
Expand Down
8 changes: 8 additions & 0 deletions src/resources/ui/context.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Gtk 4.0;
using Adw 1;

template $OMPContextPanel : Adw.Bin {
Gtk.Label {
label: 'Herpa';
}
}
1 change: 1 addition & 0 deletions src/resources/ui/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
blueprints = custom_target('blueprints',
input: files(
'context.blp',
'content.blp',
'sidebar.blp',
'window.blp'
Expand Down

0 comments on commit 545236f

Please sign in to comment.