UNPKG

@qooxdoo/framework

Version:

The JS Framework for Coders

87 lines (66 loc) 1.98 kB
/* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: MIT: https://opensource.org/licenses/MIT See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) ************************************************************************ */ /** * The normal toolbar button. Like a normal {@link qx.ui.form.Button} * but with a style matching the toolbar and without keyboard support. */ qx.Class.define("qx.ui.toolbar.Button", { extend : qx.ui.form.Button, /* ***************************************************************************** CONSTRUCTOR ***************************************************************************** */ construct : function(label, icon, command) { this.base(arguments, label, icon, command); // Toolbar buttons should not support the keyboard events this.removeListener("keydown", this._onKeyDown); this.removeListener("keyup", this._onKeyUp); }, /* ***************************************************************************** PROPERTIES ***************************************************************************** */ properties : { appearance : { refine : true, init : "toolbar-button" }, show : { refine : true, init : "inherit" }, focusable : { refine : true, init : false } }, members : { // overridden _applyVisibility : function(value, old) { this.base(arguments, value, old); // trigger a appearance recalculation of the parent var parent = this.getLayoutParent(); if (parent && parent instanceof qx.ui.toolbar.PartContainer) { qx.ui.core.queue.Appearance.add(parent); } } } });