summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Erias Morandeira <femorandeira@igalia.com>2013-05-20 16:57:38 +0100
committerFelipe Erias Morandeira <femorandeira@igalia.com>2013-06-03 12:19:03 +0200
commit23b29b307481a2a12bbf6b318a1b252e78de413b (patch)
treec1f9d706f20c27b224f6b121732817319c5a1b37
parent1a63067ce94964e73ac12387f3dd9af123a49714 (diff)
Smoke test for EosActionButton; eosactionbutton.css contains the style settings that should eventually make it to eos-theme
[endlessm/eos-sdk#30]
-rw-r--r--test/smoke-tests/action-buttons.js59
-rw-r--r--test/smoke-tests/eosactionbutton.css56
2 files changed, 115 insertions, 0 deletions
diff --git a/test/smoke-tests/action-buttons.js b/test/smoke-tests/action-buttons.js
new file mode 100644
index 0000000..04e3ae9
--- /dev/null
+++ b/test/smoke-tests/action-buttons.js
@@ -0,0 +1,59 @@
+// Copyright 2013 Endless Mobile, Inc.
+
+const Lang = imports.lang;
+const Endless = imports.gi.Endless;
+const Gtk = imports.gi.Gtk;
+
+const TEST_APPLICATION_ID = 'com.endlessm.example.test-action-buttons';
+
+const TestApplication = new Lang.Class ({
+ Name: 'TestApplication',
+ Extends: Endless.Application,
+
+ vfunc_startup: function() {
+ this.parent();
+
+ this._page = new Gtk.Grid();
+
+ /* should be using Endless.EOS_ACTION_BUTTON_SIZE_PRIMARY */
+
+ this._eosButton0 = new Endless.ActionButton({size: 0, label: 'SMILE', 'icon-id': 'face-smile-symbolic' });
+ this._page.attach(this._eosButton0, 0, 0, 1, 1);
+
+ this._eosButton1 = new Endless.ActionButton({size: 1, label: 'POUT', 'icon-id': 'face-sad-symbolic' });
+ this._page.attach(this._eosButton1, 0, 1, 1, 1);
+
+ this._eosButton2 = new Endless.ActionButton({size: 2, label: '', 'icon-id': 'edit-delete-symbolic' });
+ this._page.attach(this._eosButton2, 0, 2, 1, 1);
+
+ this._eosButton3 = new Endless.ActionButton({size: 3, label: '', 'icon-id': 'object-select-symbolic' });
+ this._page.attach(this._eosButton3, 0, 3, 1, 1);
+
+ this._pm = new Endless.PageManager();
+ this._pm.add(this._page, { name: "page" });
+
+ let provider = new Gtk.CssProvider ();
+ provider.load_from_path ('./test/smoke-tests/eosactionbutton.css');
+
+ this._window = new Endless.Window({
+ application: this,
+ border_width: 16,
+ page_manager: this._pm
+ });
+
+ let context = new Gtk.StyleContext();
+ context.add_provider_for_screen(this._window.get_screen(),
+ provider,
+ Gtk.STYLE_PROVIDER_PRIORITY_USER);
+
+ this._window.show_all();
+ },
+
+ _onButtonClicked: function () {
+ this._window.destroy();
+ },
+});
+
+let app = new TestApplication({ application_id: TEST_APPLICATION_ID,
+ flags: 0 });
+app.run(ARGV);
diff --git a/test/smoke-tests/eosactionbutton.css b/test/smoke-tests/eosactionbutton.css
new file mode 100644
index 0000000..6fd657b
--- /dev/null
+++ b/test/smoke-tests/eosactionbutton.css
@@ -0,0 +1,56 @@
+EosActionButton {
+ background-color: transparent;
+ border-color: #012345;
+ border-radius: 32px;
+ border-width: 8px;
+ border-style: solid;
+ margin: 10px;
+}
+
+/* ****** SIZES ****** */
+
+EosActionButton.primary {
+ border-radius: 32px;
+ border-width: 8px;
+}
+
+EosActionButton.secondary {
+ border-radius: 24px;
+ border-width: 6px;
+}
+
+EosActionButton.tertiary {
+ border-radius: 18px;
+ border-width: 5px;
+}
+
+EosActionButton.quaternary {
+ border-radius: 13px;
+ border-width: 4px;
+}
+
+/* ****** STATES ****** */
+
+EosActionButton:active {
+ border-color: #123456;
+}
+
+EosActionButton:hover {
+ border-color: #234567;
+}
+
+EosActionButton:insensitive {
+ border-color: #345678;
+}
+
+EosActionButton:selected {
+ border-color: #456789;
+}
+
+EosActionButton:focused {
+ border-color: #56789A;
+}
+
+EosActionButton:inconsistent {
+ border-color: #6789AB;
+}