Skip to content

Commit

Permalink
fix font
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Apr 17, 2012
1 parent 810990b commit 55e1450
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 57 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ class Text extends Rectangle
'dblclick': 'startEditing' 'dblclick': 'startEditing'
'dblclick .thumb.br': 'fitToText' 'dblclick .thumb.br': 'fitToText'


textDefaults: -> defaults: ->
result = result =
height: 30 height: 30
fontSize: 18 fontSize: 18
backgroundColor: new Color.Transparent backgroundColor: new Color.Transparent


$.extend({}, super, result)

constructor: (attrs = {}) -> constructor: (attrs = {}) ->
super super

@set(@textDefaults())
@text(attrs.text) @text(attrs.text)


startEditing: -> startEditing: ->
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class Font extends Spine.Controller
'select[name=family]': '$family' 'select[name=family]': '$family'


events: events:
'change input, select': 'change' 'change input': 'change'
'change select': 'change'


constructor: -> constructor: ->
super super
Expand Down
4 changes: 3 additions & 1 deletion assets/javascripts/app/views/inspector/font.jst.eco
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
<select name="family"> <select name="family">
<option></option> <option></option>
<option value="'Lucida Grande', Lucida, Verdana, sans-serif">Lucida Grande, Lucida, Verdana, sans-serif</option> <option value="'Lucida Grande', Lucida, Verdana, sans-serif">Lucida Grande, Lucida, Verdana, sans-serif</option>
<option value="'Helvetica Neue', Arial, Helvetica, Geneva, sans-serif">'Helvetica Neue', Arial, Helvetica, Geneva, sans-serif</option> <option value="'Helvetica Neue', Arial, Helvetica, Geneva, sans-serif">Helvetica Neue, Arial, Helvetica, Geneva, sans-serif</option>
<option value="Georgia, 'Times New Roman', Times, serif">Georgia, Times New Roman, Times, serif</option>
<option value="'Courier New', Courier, mono">Courier New, Courier, mono</option>
</select> </select>
</label> </label>
</article> </article>
23 changes: 6 additions & 17 deletions assets/stylesheets/app/inspector.css.styl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
border-left: 1px solid #C6C6C6 border-left: 1px solid #C6C6C6
border-bottom: 1px solid darken(#DDDDDD, 10%) border-bottom: 1px solid darken(#DDDDDD, 10%)
// text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.8) // text-shadow: 0px 1px 0px rgba(255, 255, 255, 0.8)
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.5) text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.3)
text-transform: uppercase text-transform: uppercase
font-weight: bold font-weight: bold
font-size: 11px font-size: 11px
Expand All @@ -42,7 +42,7 @@
} }


&:active, &.active { &:active, &.active {
background: rgba(255, 255, 255, 0.13) background: rgba(255, 255, 255, 0.18)
} }
} }
} }
Expand Down Expand Up @@ -100,17 +100,6 @@
inset-box-shadow(0, 1px, 2px, rgba(0, 0, 0, 0.1)) inset-box-shadow(0, 1px, 2px, rgba(0, 0, 0, 0.1))
} }


input[type=text], input[type=url], input[type=number], input[type=color], textarea, select {
&:focus {
outline: none
border-color: rgba(104, 189, 244, 0.8)

-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(104, 189, 244, 0.6)
-moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(104, 189, 244, 0.6)
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(104, 189, 244, 0.6)
}
}

input[disabled] { input[disabled] {
opacity: 0.8 opacity: 0.8
} }
Expand Down Expand Up @@ -190,17 +179,17 @@
.item { .item {
padding: 8px padding: 8px
cursor: pointer cursor: pointer
border-bottom: 1px solid rgba(0, 0, 0, 0.25) border-bottom: 1px solid rgba(0, 0, 0, 0.2)
ellipsis() ellipsis()


&:last-child { &:last-child {
border-bottom: none border-bottom: none
} }


&.selected { &.selected {
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8) color: #FFF
color: #5B5B5B text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2)
vbg-gradient(rgb(245, 245, 245), rgb(230, 230, 230)) vbg-gradient(#BCC6DE, #9BA8C7)
} }


.preview { .preview {
Expand Down
2 changes: 1 addition & 1 deletion assets/stylesheets/app/inspector/font.css.styl
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
#app .inspector .font { #app .inspector .font {
label span { label span {
width: 40px width: 45px
} }


select { select {
Expand Down
6 changes: 3 additions & 3 deletions public/assets/app/controllers/elements/text.module.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@ this.require.define({"app/controllers/elements/text":function(exports, require,
'dblclick .thumb.br': 'fitToText' 'dblclick .thumb.br': 'fitToText'
}; };


Text.prototype.textDefaults = function() { Text.prototype.defaults = function() {
var result; var result;
return result = { result = {
height: 30, height: 30,
fontSize: 18, fontSize: 18,
backgroundColor: new Color.Transparent backgroundColor: new Color.Transparent
}; };
return $.extend({}, Text.__super__.defaults.apply(this, arguments), result);
}; };


function Text(attrs) { function Text(attrs) {
if (attrs == null) { if (attrs == null) {
attrs = {}; attrs = {};
} }
Text.__super__.constructor.apply(this, arguments); Text.__super__.constructor.apply(this, arguments);
this.set(this.textDefaults());
this.text(attrs.text); this.text(attrs.text);
} }


Expand Down
3 changes: 2 additions & 1 deletion public/assets/app/controllers/inspector/font.module.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ this.require.define({"app/controllers/inspector/font":function(exports, require,
}; };


Font.prototype.events = { Font.prototype.events = {
'change input, select': 'change' 'change input': 'change',
'change select': 'change'
}; };


function Font() { function Font() {
Expand Down
36 changes: 11 additions & 25 deletions public/assets/application.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ body {
color: #fff; color: #fff;
border-left: 1px solid #c6c6c6; border-left: 1px solid #c6c6c6;
border-bottom: 1px solid #c7c7c7; border-bottom: 1px solid #c7c7c7;
text-shadow: 0px -1px 0px rgba(0,0,0,0.50); text-shadow: 0px -1px 0px rgba(0,0,0,0.30);
text-transform: uppercase; text-transform: uppercase;
font-weight: bold; font-weight: bold;
font-size: 11px; font-size: 11px;
Expand All @@ -332,7 +332,7 @@ body {
} }
#app .inspector header div:active, #app .inspector header div:active,
#app .inspector header div.active { #app .inspector header div.active {
background: rgba(255,255,255,0.13); background: rgba(255,255,255,0.18);
} }
#app .inspector .textInspector, #app .inspector .textInspector,
#app .inspector .displayInspector { #app .inspector .displayInspector {
Expand Down Expand Up @@ -393,20 +393,6 @@ body {
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.10); -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.10);
box-shadow: inset 0 1px 2px rgba(0,0,0,0.10); box-shadow: inset 0 1px 2px rgba(0,0,0,0.10);
} }
#app .inspector input[type=text]:focus,
#app .inspector input[type=url]:focus,
#app .inspector input[type=number]:focus,
#app .inspector input[type=color]:focus,
#app .inspector textarea:focus,
#app .inspector select:focus {
outline: none;
border-color: rgba(104,189,244,0.80);
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.20), 0 1px 5px 0 rgba(104,189,244,0.60);
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.20), 0 1px 5px 0 rgba(104,189,244,0.60);
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.20), 0 1px 5px 0 rgba(104,189,244,0.60);
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.20), 0 1px 5px 0 rgba(104,189,244,0.60);
box-shadow: inset 0 1px 2px rgba(0,0,0,0.20), 0 1px 5px 0 rgba(104,189,244,0.60);
}
#app .inspector input[disabled] { #app .inspector input[disabled] {
opacity: 0.8; opacity: 0.8;
} }
Expand Down Expand Up @@ -479,7 +465,7 @@ body {
#app .inspector .list .item { #app .inspector .list .item {
padding: 8px; padding: 8px;
cursor: pointer; cursor: pointer;
border-bottom: 1px solid rgba(0,0,0,0.25); border-bottom: 1px solid rgba(0,0,0,0.20);
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
Expand All @@ -488,13 +474,13 @@ body {
border-bottom: none; border-bottom: none;
} }
#app .inspector .list .item.selected { #app .inspector .list .item.selected {
text-shadow: 0 1px 1px rgba(255,255,255,0.80); color: #fff;
color: #5b5b5b; text-shadow: 0 -1px 0 rgba(0,0,0,0.20);
background: #f5f5f5; background: #bcc6de;
background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e6e6e6)); background: -webkit-gradient(linear, left top, left bottom, from(#bcc6de), to(#9ba8c7));
background: -webkit-linear-gradient(top, #f5f5f5, #e6e6e6); background: -webkit-linear-gradient(top, #bcc6de, #9ba8c7);
background: -moz-linear-gradient(top, #f5f5f5, #e6e6e6); background: -moz-linear-gradient(top, #bcc6de, #9ba8c7);
background: linear-gradient(top, #f5f5f5, #e6e6e6); background: linear-gradient(top, #bcc6de, #9ba8c7);
} }
#app .inspector .list .item .preview { #app .inspector .list .item .preview {
margin: 0 3px 0 0; margin: 0 3px 0 0;
Expand Down Expand Up @@ -755,7 +741,7 @@ body {
width: 15px; width: 15px;
} }
#app .inspector .font label span { #app .inspector .font label span {
width: 40px; width: 45px;
} }
#app .inspector .font select { #app .inspector .font select {
width: 120px; width: 120px;
Expand Down
11 changes: 6 additions & 5 deletions public/assets/application.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13093,21 +13093,21 @@ this.require.define({"app/controllers/elements/text":function(exports, require,
'dblclick .thumb.br': 'fitToText' 'dblclick .thumb.br': 'fitToText'
}; };


Text.prototype.textDefaults = function() { Text.prototype.defaults = function() {
var result; var result;
return result = { result = {
height: 30, height: 30,
fontSize: 18, fontSize: 18,
backgroundColor: new Color.Transparent backgroundColor: new Color.Transparent
}; };
return $.extend({}, Text.__super__.defaults.apply(this, arguments), result);
}; };


function Text(attrs) { function Text(attrs) {
if (attrs == null) { if (attrs == null) {
attrs = {}; attrs = {};
} }
Text.__super__.constructor.apply(this, arguments); Text.__super__.constructor.apply(this, arguments);
this.set(this.textDefaults());
this.text(attrs.text); this.text(attrs.text);
} }


Expand Down Expand Up @@ -14298,7 +14298,8 @@ this.require.define({"app/controllers/inspector/font":function(exports, require,
}; };


Font.prototype.events = { Font.prototype.events = {
'change input, select': 'change' 'change input': 'change',
'change select': 'change'
}; };


function Font() { function Font() {
Expand Down Expand Up @@ -17904,7 +17905,7 @@ this.require.define({"app/models/serialize":function(exports, require, module){(
(function() { (function() {
(function() { (function() {


__out.push('<h3>Font</h3>\n\n<article>\n <label>\n <span>Size</span>\n <input type="number" name="size" placeholder="0px">\n </label>\n\n <label class="color">\n <span>Color</span>\n <input type="color" name="color">\n </label>\n\n <label>\n <span>Family</span>\n <select name="family">\n <option></option>\n <option value="\'Lucida Grande\', Lucida, Verdana, sans-serif">Lucida Grande, Lucida, Verdana, sans-serif</option>\n <option value="\'Helvetica Neue\', Arial, Helvetica, Geneva, sans-serif">\'Helvetica Neue\', Arial, Helvetica, Geneva, sans-serif</option>\n </select>\n </label>\n</article>\n'); __out.push('<h3>Font</h3>\n\n<article>\n <label>\n <span>Size</span>\n <input type="number" name="size" placeholder="0px">\n </label>\n\n <label class="color">\n <span>Color</span>\n <input type="color" name="color">\n </label>\n\n <label>\n <span>Family</span>\n <select name="family">\n <option></option>\n <option value="\'Lucida Grande\', Lucida, Verdana, sans-serif">Lucida Grande, Lucida, Verdana, sans-serif</option>\n <option value="\'Helvetica Neue\', Arial, Helvetica, Geneva, sans-serif">Helvetica Neue, Arial, Helvetica, Geneva, sans-serif</option>\n <option value="Georgia, \'Times New Roman\', Times, serif">Georgia, Times New Roman, Times, serif</option>\n <option value="\'Courier New\', Courier, mono">Courier New, Courier, mono</option>\n </select>\n </label>\n</article>\n');


}).call(this); }).call(this);


Expand Down

0 comments on commit 55e1450

Please sign in to comment.