From 9231460b3960e703a10da458f7020de51022004d Mon Sep 17 00:00:00 2001 From: Matt Watson Date: Mon, 3 Jun 2013 11:09:54 -0700 Subject: No background animation switching between pages with same background When background URI is changes for the currently visible page, it will switch backgrounds without a transition animation. [endlessm/eos-sdk#88] --- test/smoke-tests/app-window.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'test/smoke-tests') diff --git a/test/smoke-tests/app-window.js b/test/smoke-tests/app-window.js index ac0907b..e05ae5a 100644 --- a/test/smoke-tests/app-window.js +++ b/test/smoke-tests/app-window.js @@ -7,6 +7,8 @@ const GObject = imports.gi.GObject; const TEST_APPLICATION_ID = 'com.endlessm.example.test'; +const CAT_BACKGROUND_PATH = './test/smoke-tests/images/cat_eye.jpg'; +const DOG_BACKGROUND_PATH = './test/smoke-tests/images/dog_eye.jpg'; const Page0 = new Lang.Class ({ Name: 'Page0', @@ -78,6 +80,8 @@ const Page1 = new Lang.Class ({ this.add(this.button1); this.button2 = new Gtk.Button({ label: 'Go to page named "page0"' }); this.add(this.button2); + this.button3 = new Gtk.Button({ label: 'Swap this page background' }); + this.add(this.button3); } }); @@ -130,6 +134,15 @@ const TestApplication = new Lang.Class ({ this._page1.button2.connect('clicked', Lang.bind(this, function () { this._pm.visible_page_name = "page0"; })); + this._page1.button3.connect('clicked', Lang.bind(this, function () { + let background_uri = this._pm.get_page_background_uri(this._page1); + if (background_uri === CAT_BACKGROUND_PATH) + background_uri = DOG_BACKGROUND_PATH; + else + background_uri = CAT_BACKGROUND_PATH; + this._pm.set_page_background_uri(this._page1, background_uri); + })); + this._toolbox = new Toolbox(); this._toolbox.switch1.connect('notify::active', Lang.bind(this, function () { @@ -143,12 +156,12 @@ const TestApplication = new Lang.Class ({ this._pm.add(this._page0, { name: "page0", - background_uri: "./test/smoke-tests/images/cat_eye.jpg", + background_uri: CAT_BACKGROUND_PATH, custom_toolbox_widget: this._toolbox }); this._pm.add(this._page1, { name: "page1", - background_uri: "./test/smoke-tests/images/dog_eye.jpg", + background_uri: DOG_BACKGROUND_PATH, custom_toolbox_widget: this._toolbox, page_actions: true }); -- cgit v1.2.3