Skip to content

Commit

Permalink
Add label for priority
Browse files Browse the repository at this point in the history
  • Loading branch information
meisenzahl committed Oct 25, 2020
1 parent 208eb8b commit 926a611
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 11 deletions.
22 changes: 22 additions & 0 deletions demo/Application.vala
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/*
* Copyright 2020 elementary, Inc. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authored by: Marius Meisenzahl <mariusmeisenzahl@gmail.com>
*
*/

public class Application : Gtk.Application {
private MainWindow window;

Expand Down
50 changes: 42 additions & 8 deletions demo/MainWindow.vala
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/*
* Copyright 2020 elementary, Inc. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authored by: Marius Meisenzahl <mariusmeisenzahl@gmail.com>
*
*/

public class MainWindow : Gtk.ApplicationWindow {
private Gtk.Entry title_entry;
private Gtk.Entry body_entry;
Expand All @@ -11,43 +33,55 @@ public class MainWindow : Gtk.ApplicationWindow {
set_default_size (400, 400);

var grid = new Gtk.Grid () {
orientation = Gtk.Orientation.VERTICAL,
halign = Gtk.Align.CENTER,
valign = Gtk.Align.CENTER,
row_spacing = 12,
margin_start = margin_end = 6
row_spacing = 12
};

title_entry = new Gtk.Entry () {
hexpand = true,
placeholder_text = "Title",
text = "Title"
};
grid.attach (title_entry, 0, 0);
grid.add (title_entry);

body_entry = new Gtk.Entry () {
hexpand = true,
placeholder_text = "Body",
text = "Body"
};
grid.attach (body_entry, 0, 1);
grid.add (body_entry);

id_entry = new Gtk.Entry () {
hexpand = true,
placeholder_text = "Id"
};
grid.attach (id_entry, 0, 2);
grid.add (id_entry);

var priority_label = new Gtk.Label ("Priority:");

priority_combobox = new Gtk.ComboBoxText ();
priority_combobox = new Gtk.ComboBoxText () {
hexpand = true
};
priority_combobox.append_text ("low");
priority_combobox.append_text ("normal");
priority_combobox.append_text ("high");
priority_combobox.append_text ("urgent");
priority_combobox.set_active (1);
grid.attach (priority_combobox, 0, 3);

var priority_grid = new Gtk.Grid () {
column_spacing = 6,
margin = 6
};
priority_grid.add (priority_label);
priority_grid.add (priority_combobox);
grid.add (priority_grid);


var send_button = new Gtk.Button.with_label ("Send notification");
send_button.clicked.connect (send_notification);
grid.attach (send_button, 0, 4);
grid.add (send_button);

add (grid);
}
Expand Down
4 changes: 1 addition & 3 deletions demo/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
project('io.elementary.notifications.demo', 'vala', 'c')

executable(
meson.project_name(),
'io.elementary.notifications.demo',
'Application.vala',
'MainWindow.vala',
dependencies : [
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ executable(
)

subdir('data')
subdir('demo')
subdir('po')

meson.add_install_script('meson/post_install.py')

0 comments on commit 926a611

Please sign in to comment.