Ardour
9.0-pre0-582-g084a23a80d
searchbar.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
*/
18
19
#pragma once
20
21
#include <
gtkmm/entry.h
>
22
#include <string>
23
24
#include "
widgets/visibility.h
"
25
26
namespace
ArdourWidgets
{
27
28
class
LIBWIDGETS_API
SearchBar
:
public
Gtk::Entry
29
{
30
public
:
31
SearchBar
(
32
const
std::string& placeholder_text =
"Search..."
,
33
bool
icon_click_resets =
true
);
34
36
void
reset
();
37
38
/* emitted when the filter has been updated */
39
sigc::signal<void, const std::string&>
signal_search_string_updated
() {
return
sig_search_string_updated; }
40
41
protected
:
42
bool
focus_in_event
(
GdkEventFocus
*);
43
bool
focus_out_event
(
GdkEventFocus
*);
44
45
bool
key_press_event
(
GdkEventKey
*);
46
void
icon_clicked_event
(
Gtk::EntryIconPosition
,
const
GdkEventButton
*);
47
48
const
std::string
placeholder_text
;
49
sigc::signal<void, const std::string&>
sig_search_string_updated
;
50
51
private
:
52
void
search_string_changed
()
const
;
53
54
Glib::RefPtr<Gdk::Pixbuf>
icon
;
55
bool
icon_click_resets
;
56
};
57
58
}
/* end namespace */
ArdourWidgets::SearchBar
Definition:
searchbar.h:29
ArdourWidgets::SearchBar::reset
void reset()
ArdourWidgets::SearchBar::signal_search_string_updated
sigc::signal< void, const std::string & > signal_search_string_updated()
Definition:
searchbar.h:39
ArdourWidgets::SearchBar::focus_in_event
bool focus_in_event(GdkEventFocus *)
ArdourWidgets::SearchBar::icon_clicked_event
void icon_clicked_event(Gtk::EntryIconPosition, const GdkEventButton *)
ArdourWidgets::SearchBar::search_string_changed
void search_string_changed() const
ArdourWidgets::SearchBar::focus_out_event
bool focus_out_event(GdkEventFocus *)
ArdourWidgets::SearchBar::SearchBar
SearchBar(const std::string &placeholder_text="Search...", bool icon_click_resets=true)
ArdourWidgets::SearchBar::icon
Glib::RefPtr< Gdk::Pixbuf > icon
Definition:
searchbar.h:54
ArdourWidgets::SearchBar::placeholder_text
const std::string placeholder_text
Definition:
searchbar.h:48
ArdourWidgets::SearchBar::key_press_event
bool key_press_event(GdkEventKey *)
ArdourWidgets::SearchBar::sig_search_string_updated
sigc::signal< void, const std::string & > sig_search_string_updated
Definition:
searchbar.h:49
ArdourWidgets::SearchBar::icon_click_resets
bool icon_click_resets
Definition:
searchbar.h:55
Gtk::Entry
Definition:
entry.h:101
entry.h
Gtk::EntryIconPosition
EntryIconPosition
Definition:
entry.h:60
ArdourWidgets
Definition:
ardour_ui.h:192
_GdkEventButton
Definition:
gdkevents.h:321
_GdkEventFocus
Definition:
gdkevents.h:400
_GdkEventKey
Definition:
gdkevents.h:368
visibility.h
LIBWIDGETS_API
#define LIBWIDGETS_API
Definition:
widgets/widgets/visibility.h:39
libs
widgets
widgets
searchbar.h
Generated on Wed Dec 25 2024 05:44:46 for Ardour by
1.9.1