Fix padding of widgets.

This commit is contained in:
Jonathan Frederic 2014-12-08 17:05:58 -08:00
parent 8160308bb2
commit cb12229480
9 changed files with 55 additions and 33 deletions

View File

@ -1403,7 +1403,7 @@ h6:hover .anchor-link {
.widget-text {
/* String Textbox - used for TextBoxView and TextAreaView */
width: 350px;
margin: 0px !important;
margin: 0px;
}
.widget-listbox {
/* Listbox */
@ -1413,7 +1413,7 @@ h6:hover .anchor-link {
.widget-numeric-text {
/* Single Line Textbox - used for IntTextView and FloatTextView */
width: 150px;
margin: 0px !important;
margin: 0px;
}
.widget-progress {
/* Progress Bar */
@ -1451,10 +1451,6 @@ h6:hover .anchor-link {
display: flex;
flex-direction: row;
align-items: stretch;
margin-top: 0px !important;
margin-bottom: 0px !important;
margin-right: 5px;
margin-left: 5px;
}
.widget-hbox input[type="checkbox"] {
margin-top: 9px;

View File

@ -7752,9 +7752,6 @@ div#header {
/* Initially hidden to prevent FLOUC */
display: none;
background-color: #ffffff;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
/* Display over codemirror */
z-index: 100;
}
@ -9246,7 +9243,7 @@ h6:hover .anchor-link {
.widget-text {
/* String Textbox - used for TextBoxView and TextAreaView */
width: 350px;
margin: 0px !important;
margin: 0px;
}
.widget-listbox {
/* Listbox */
@ -9256,7 +9253,7 @@ h6:hover .anchor-link {
.widget-numeric-text {
/* Single Line Textbox - used for IntTextView and FloatTextView */
width: 150px;
margin: 0px !important;
margin: 0px;
}
.widget-progress {
/* Progress Bar */
@ -9294,10 +9291,6 @@ h6:hover .anchor-link {
display: flex;
flex-direction: row;
align-items: stretch;
margin-top: 0px !important;
margin-bottom: 0px !important;
margin-right: 5px;
margin-left: 5px;
}
.widget-hbox input[type="checkbox"] {
margin-top: 9px;
@ -9681,7 +9674,6 @@ fieldset[disabled] #kernel_selector_widget > button.active {
margin-top: 0px;
}
#menubar {
margin-top: 0px;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;

View File

@ -30,7 +30,11 @@ define([
/**
* Set a css attr of the widget view.
*/
this.$checkbox.css(name, value);
if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$checkbox.css(name, value);
}
},
handle_click: function() {

View File

@ -57,6 +57,8 @@ define([
this.$slider_container.css(name, value);
} else if (name == 'width' || name == 'height' || name == 'background') {
this.$slider_container.css(name, value);
} else if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$slider.css(name, value);
}
@ -333,7 +335,11 @@ define([
/**
* Set a css attr of the widget view.
*/
this.$textbox.css(name, value);
if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$textbox.css(name, value);
}
},
events: {
@ -468,6 +474,8 @@ define([
this.$progress.css(name, value);
} else if (name == 'color') {
this.$bar.css('background', value);
} else if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$bar.css(name, value);
}

View File

@ -135,6 +135,8 @@ define([
} else if (name == 'height') {
this.$droplabel.css(name, value);
this.$dropbutton.css(name, value);
} else if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$droplist.css(name, value);
this.$droplabel.css(name, value);
@ -241,7 +243,11 @@ define([
/**
* Set a css attr of the widget view.
*/
this.$container.css(name, value);
if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$container.css(name, value);
}
},
handle_click: function (e) {
@ -356,8 +362,12 @@ define([
/**
* Set a css attr of the widget view.
*/
this._css_state[name] = value;
this.update_style_traits();
if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this._css_state[name] = value;
this.update_style_traits();
}
},
update_style_traits: function(button) {
@ -478,7 +488,11 @@ define([
/**
* Set a css attr of the widget view.
*/
this.$listbox.css(name, value);
if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$listbox.css(name, value);
}
},
handle_click: function (e) {

View File

@ -184,7 +184,11 @@ define([
/**
* Set a css attr of the widget view.
*/
this.$tabs.css(name, value);
if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$tabs.css(name, value);
}
},
remove_child_view: function(view) {

View File

@ -125,7 +125,11 @@ define([
/**
* Set a css attr of the widget view.
*/
this.$textbox.css(name, value);
if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$textbox.css(name, value);
}
},
events: {
@ -208,7 +212,11 @@ define([
/**
* Set a css attr of the widget view.
*/
this.$textbox.css(name, value);
if (name == 'padding' || name == 'margin') {
this.$el.css(name, value);
} else {
this.$textbox.css(name, value);
}
},
events: {

View File

@ -145,8 +145,8 @@
.widget-text {
/* String Textbox - used for TextBoxView and TextAreaView */
width : 350px;
margin : 0px !important;
width : 350px;
margin : 0px;
}
.widget-listbox {
@ -158,7 +158,7 @@
.widget-numeric-text {
/* Single Line Textbox - used for IntTextView and FloatTextView */
width : 150px;
margin : 0px !important;
margin : 0px;
}
.widget-progress {
@ -188,10 +188,6 @@
.widget-hbox {
/* Horizontal widgets */
.hbox();
margin-top: 0px !important;
margin-bottom: 0px !important;
margin-right: 5px;
margin-left: 5px;
input[type="checkbox"] {
margin-top: 9px;

View File

@ -427,7 +427,7 @@ class DOMWidget(Widget):
width = CUnicode(sync=True)
height = CUnicode(sync=True)
padding = CUnicode(sync=True)
padding = CUnicode(2.5, sync=True)
margin = CUnicode(sync=True)
color = Unicode(sync=True)