Debian Codegraph @

src/scores/category_bar.rs

raw symbols SCIP
1 /*
2 * Copyright 2024 Andrey Kutejko <[email protected]>
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 3 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
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 *
17 * For more details see the file COPYING.
18 */
19
20 use gettextrs::gettext;
21 use gtk::prelude::*;
22
23 pub fn category_bar(child: &impl IsA<gtk::Widget>) -> gtk::Widget {
24 let catbar = gtk::Box::builder()
25 .orientation(gtk::Orientation::Horizontal)
26 .spacing(12)
27 .margin_top(20)
28 .margin_start(20)
29 .margin_end(20)
30 .halign(gtk::Align::Center)
31 .build();
32
33 let label = gtk::Label::builder()
34 .label(gettext("Game Type:"))
35 .halign(gtk::Align::Center)
36 .build();
37 catbar.append(&label);
38
39 catbar.append(child);
40
41 catbar.upcast()
42 }