allow themes to set padding

This commit is contained in:
nightwing 2012-11-04 23:48:46 +04:00
commit 329ed752db

View file

@ -104,7 +104,6 @@ var VirtualRenderer = function(container, theme) {
this.$markerFront = new MarkerLayer(this.content);
this.$cursorLayer = new CursorLayer(this.content);
this.$cursorPadding = 8;
// Indicates whether the horizontal scrollbar is visible
this.$horizScroll = false;
@ -1324,18 +1323,19 @@ var VirtualRenderer = function(container, theme) {
_self.container.ownerDocument
);
if (_self.$theme)
dom.removeCssClass(_self.container, _self.$theme);
if (_self.theme)
dom.removeCssClass(_self.container, _self.theme.cssClass);
_self.$theme = theme ? theme.cssClass : null;
// this is kept only for backwards compatibility
_self.$theme = theme.cssClass;
if (_self.$theme)
dom.addCssClass(_self.container, _self.$theme);
_self.theme = theme;
dom.addCssClass(_self.container, theme.cssClass);
dom.setCssClass(_self.container, "ace_dark", theme.isDark);
if (theme && theme.isDark)
dom.addCssClass(_self.container, "ace_dark");
else
dom.removeCssClass(_self.container, "ace_dark");
var padding = theme.padding || 4;
if (_self.$padding && padding != _self.$padding)
_self.setPadding(padding);
// force re-measure of the gutter width
if (_self.$size) {