Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
foldable_notebook.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
10#ifndef __GUI_WIDGETS_FOLDABLE_NOTEBOOK_H__
11#define __GUI_WIDGETS_FOLDABLE_NOTEBOOK_H__
12
13#include "gtk_wrapper.h"
14
15#define FOLDABLE_NOTEBOOK_WIDGET_TYPE (foldable_notebook_widget_get_type ())
16G_DECLARE_FINAL_TYPE (
18 foldable_notebook_widget,
19 Z,
20 FOLDABLE_NOTEBOOK_WIDGET,
21 GtkBox);
22
29#define MW_BOT_FOLDABLE_NOTEBOOK MW_BOT_DOCK_EDGE->bot_notebook
30
40typedef struct _FoldableNotebookWidget
41{
42 GtkBox parent_instance;
43
44 GtkNotebook * notebook;
45
46 GtkGestureClick * mp;
47
50 GtkPaned * paned;
51
53 GtkPositionType pos_in_paned;
54
57 // int prev_paned_pos;
58
61
65
72 GtkWidget * tab_during_press;
73
74 gulong switch_page_handler_id;
76
81foldable_notebook_widget_new (GtkPositionType pos_in_paned, bool with_text);
82
86GtkWidget *
89 int page);
90
98GtkWidget *
100
104void
107 bool new_visibility);
108
113int
115
119GtkNotebook *
121
122void
123foldable_notebook_widget_set_current_page (
125 int page_num,
126 bool block_signals);
127
128int
129foldable_notebook_widget_get_current_page (FoldableNotebookWidget * self);
130
131void
132foldable_notebook_widget_add_page (
134 GtkWidget * child,
135 const char * tab_icon_name,
136 const char * tab_label,
137 const char * tooltip);
138
142void
144
148void
151 GtkPaned * paned,
152 GtkPositionType pos_in_paned,
153 bool with_text);
154
159#endif
void foldable_notebook_widget_toggle_visibility(FoldableNotebookWidget *self)
Combines the above.
GtkWidget * foldable_notebook_widget_get_current_widget(FoldableNotebookWidget *self)
Get the widget currently visible.
FoldableNotebookWidget * foldable_notebook_widget_new(GtkPositionType pos_in_paned, bool with_text)
Creates a FoldableNotebookWidget.
int foldable_notebook_widget_is_content_visible(FoldableNotebookWidget *self)
Returns if the content of the foldable notebook is visible.
void foldable_notebook_widget_set_visibility(FoldableNotebookWidget *self, bool new_visibility)
Sets the folded space visible or not.
void foldable_notebook_widget_setup(FoldableNotebookWidget *self, GtkPaned *paned, GtkPositionType pos_in_paned, bool with_text)
Sets up an existing FoldableNotebookWidget.
GtkWidget * foldable_notebook_widget_get_widget_at_page(FoldableNotebookWidget *self, int page)
Get the widget at the given page.
GtkNotebook * foldable_notebook_widget_get_notebook(FoldableNotebookWidget *self)
Gets the internal notebook.
A GtkNotebook that shows or hides itself when the same page tab is clicked.
int prev_pos
Previous paned position before setting it to max/min.
GtkPaned * paned
Paned associated with this notebook to set it to max/min when hiding.
GtkPositionType pos_in_paned
Notebook position in the paned.
GtkWidget * tab_during_press
Current tab during a press action.
bool with_text
Whether to add text to the tab labels (otherwise just icons).