Debian Codegraph @

src/KeywordRow.vala

raw
1 /* KeywordRow.vala
2 *
3 * Copyright 2023 Diego Iván <[email protected]>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * SPDX-License-Identifier: GPL-3.0-or-later
19 */
20
21 public class PaperClip.KeywordRow : Adw.EntryRow {
22 public unowned Document document { get; set; }
23
24 construct {
25 focusable = true;
26 var delete_button = new Gtk.Button.from_icon_name ("cross-symbolic") {
27 valign = CENTER,
28 css_classes = { "flat" },
29 tooltip_text = _("Delete Keyword")
30 };
31 add_prefix (delete_button);
32
33 delete_button.clicked.connect (on_delete_clicked);
34 }
35
36 private void on_delete_clicked () {
37 document.remove_keyword (text);
38 }
39 }