From da2e581a038c46641bf8d8aee38907c24f5f9167 Mon Sep 17 00:00:00 2001 From: Alexandros Theodotou Date: Mon, 25 Apr 2022 20:54:05 +0100 Subject: [PATCH] add file search entry Implements https://todo.sr.ht/~alextee/zrythm-feature/414. --- inc/audio/supported_file.h | 20 +------ inc/gui/widgets/panel_file_browser.h | 26 ++------ inc/gui/widgets/plugin_browser.h | 4 +- resources/ui/panel_file_browser.ui | 6 +- resources/ui/plugin_browser.ui | 3 +- src/gui/widgets/panel_file_browser.c | 90 +++++++++++++++++++++------- src/gui/widgets/plugin_browser.c | 23 +++++-- 7 files changed, 104 insertions(+), 68 deletions(-) diff --git a/inc/audio/supported_file.h b/inc/audio/supported_file.h index e3efa60ba..c84de4f20 100644 --- a/inc/audio/supported_file.h +++ b/inc/audio/supported_file.h @@ -1,21 +1,5 @@ -/* - * Copyright (C) 2019-2021 Alexandros Theodotou - * - * This file is part of Zrythm - * - * Zrythm is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Zrythm is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Zrythm. If not, see . - */ +// SPDX-FileCopyrightText: © 2019-2021 Alexandros Theodotou +// SPDX-License-Identifier: LicenseRef-ZrythmLicense /** * \file diff --git a/inc/gui/widgets/panel_file_browser.h b/inc/gui/widgets/panel_file_browser.h index e6f7c0451..436390d1d 100644 --- a/inc/gui/widgets/panel_file_browser.h +++ b/inc/gui/widgets/panel_file_browser.h @@ -1,21 +1,5 @@ -/* - * Copyright (C) 2019-2021 Alexandros Theodotou - * - * This file is part of Zrythm - * - * Zrythm is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Zrythm is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Zrythm. If not, see . - */ +// SPDX-FileCopyrightText: © 2019-2022 Alexandros Theodotou +// SPDX-License-Identifier: LicenseRef-ZrythmLicense #ifndef __GUI_WIDGETS_PANEL_FILE_BROWSER_H__ #define __GUI_WIDGETS_PANEL_FILE_BROWSER_H__ @@ -45,14 +29,14 @@ G_DECLARE_FINAL_TYPE ( panel_file_browser_widget, Z, PANEL_FILE_BROWSER_WIDGET, - GtkBox) + GtkWidget) #define MW_PANEL_FILE_BROWSER \ MW_RIGHT_DOCK_EDGE->file_browser typedef struct _PanelFileBrowserWidget { - GtkBox parent_instance; + GtkWidget parent_instance; GtkPaned * paned; @@ -65,6 +49,8 @@ typedef struct _PanelFileBrowserWidget GtkLabel * file_info; ZFileType selected_type; + GtkSearchEntry * file_search_entry; + GtkCustomFilter * files_filter; GtkFilterListModel * files_filter_model; GtkSingleSelection * files_selection_model; diff --git a/inc/gui/widgets/plugin_browser.h b/inc/gui/widgets/plugin_browser.h index 224cb176e..459c81eba 100644 --- a/inc/gui/widgets/plugin_browser.h +++ b/inc/gui/widgets/plugin_browser.h @@ -22,7 +22,7 @@ G_DECLARE_FINAL_TYPE ( plugin_browser_widget, Z, PLUGIN_BROWSER_WIDGET, - GtkBox) + GtkWidget) TYPEDEF_STRUCT_UNDERSCORED (ExpanderBoxWidget); TYPEDEF_STRUCT (PluginCollection); @@ -64,7 +64,7 @@ typedef enum */ typedef struct _PluginBrowserWidget { - GtkBox parent_instance; + GtkWidget parent_instance; GtkPaned * paned; diff --git a/resources/ui/panel_file_browser.ui b/resources/ui/panel_file_browser.ui index d19c2ecb9..6719537df 100644 --- a/resources/ui/panel_file_browser.ui +++ b/resources/ui/panel_file_browser.ui @@ -1,7 +1,8 @@ -