Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
sidepanel.c
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2015 Roman Lebedev.
4 Copyright (C) 2016 Tobias Ellinghaus.
5 Copyright (C) 2019 Aldric Renaudin.
6 Copyright (C) 2020-2021 Pascal Obry.
7 Copyright (C) 2021 Diederik Ter Rahe.
8 Copyright (C) 2022 Martin Baƙinka.
9
10 darktable is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14
15 darktable is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with darktable. If not, see <http://www.gnu.org/licenses/>.
22*/
23
24#include "dtgtk/sidepanel.h"
25#include "develop/imageop.h"
26
27#include <gtk/gtk.h>
28
29G_DEFINE_TYPE(GtkDarktableSidePanel, dtgtk_side_panel, GTK_TYPE_BOX);
30
31static GtkSizeRequestMode dtgtk_side_panel_get_request_mode(GtkWidget *widget)
32{
33 return GTK_SIZE_REQUEST_CONSTANT_SIZE;
34}
35
36static void dtgtk_side_panel_get_preferred_width(GtkWidget *widget, gint *minimum_size, gint *natural_size)
37{
38 GtkDarktableSidePanelClass *class = DTGTK_SIDE_PANEL_GET_CLASS(widget);
39
40 *minimum_size = *natural_size = class->width;
41}
42
44{
45 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class);
46
47 widget_class->get_request_mode = dtgtk_side_panel_get_request_mode;
48 widget_class->get_preferred_width = dtgtk_side_panel_get_preferred_width;
49
50 class->width
51 = dt_conf_get_int("min_panel_width"); // this is the miminum width, real size has to be applied after
52}
53
55{
56 gtk_widget_set_vexpand(GTK_WIDGET(panel), TRUE);
57}
58
59// public functions
61{
62 return g_object_new(dtgtk_side_panel_get_type(), "orientation", GTK_ORIENTATION_VERTICAL, NULL);
63}
64
65// clang-format off
66// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
67// vim: shiftwidth=2 expandtab tabstop=2 cindent
68// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
69// clang-format on
70
#define TRUE
Definition ashift_lsd.c:162
int dt_conf_get_int(const char *name)
static void dtgtk_side_panel_init(GtkDarktableSidePanel *panel)
Definition sidepanel.c:54
G_DEFINE_TYPE(GtkDarktableSidePanel, dtgtk_side_panel, GTK_TYPE_BOX)
GtkWidget * dtgtk_side_panel_new()
Definition sidepanel.c:60
static GtkSizeRequestMode dtgtk_side_panel_get_request_mode(GtkWidget *widget)
Definition sidepanel.c:31
static void dtgtk_side_panel_get_preferred_width(GtkWidget *widget, gint *minimum_size, gint *natural_size)
Definition sidepanel.c:36
static void dtgtk_side_panel_class_init(GtkDarktableSidePanelClass *class)
Definition sidepanel.c:43
GType dtgtk_side_panel_get_type(void)
struct _GtkWidget GtkWidget
Definition splash.h:29