Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
fix styles on statusbar indent, add tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonsanjose committed Oct 4, 2012
1 parent f7581c2 commit 9480d70
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 38 deletions.
21 changes: 11 additions & 10 deletions src/editor/EditorManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ define(function (require, exports, module) {
var $modeInfo,
$cursorInfo,
$fileInfo,
$indentInfo,
$indentType,
$indentWidth,
$indentDecrement,
$indentIncrement;

Expand Down Expand Up @@ -554,11 +555,10 @@ define(function (require, exports, module) {
}

function _updateIndentInfo(editor) {
$indentInfo.text(StringUtils.format(
Strings.STATUSBAR_INDENT,
editor._codeMirror.getOption("indentWithTabs") ? Strings.STATUSBAR_TAB_SIZE : Strings.STATUSBAR_SPACES,
editor._codeMirror.getOption("tabSize")
));
var indentWithTabs = editor._codeMirror.getOption("indentWithTabs");
$indentType.text(indentWithTabs ? Strings.STATUSBAR_TAB_SIZE : Strings.STATUSBAR_SPACES);
$indentType.attr("title", indentWithTabs ? Strings.STATUSBAR_INDENT_TOOLTIP_SPACES : Strings.STATUSBAR_INDENT_TOOLTIP_TABS);
$indentWidth.text(editor._codeMirror.getOption("tabSize"));
}

function _toggleIndentType() {
Expand Down Expand Up @@ -625,12 +625,13 @@ define(function (require, exports, module) {
$modeInfo = $("#status-mode");
$cursorInfo = $("#status-cursor");
$fileInfo = $("#status-file");
$indentInfo = $("#tab-width-label");
$indentDecrement = $("#status-indent .decrement");
$indentIncrement = $("#status-indent .increment");
$indentType = $("#indent-type");
$indentWidth = $("#indent-width");
$indentDecrement = $("#indent-decrement");
$indentIncrement = $("#indent-increment");

// indentation event handlers
$indentInfo.on("click", _toggleIndentType);
$indentType.on("click", _toggleIndentType);
$indentDecrement.on("click", function () { _updateIndentSize(-1); });
$indentIncrement.on("click", function () { _updateIndentSize(1); });

Expand Down
7 changes: 4 additions & 3 deletions src/htmlContent/main-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@
<div id="status-file"></div>
<div id="status-mode"></div>
<div id="status-indent">
<label id="tab-width-label">4</label>
<div class="decrement"></div>
<div class="increment"></div>
<div id="indent-type"></div>
<div id="indent-width"></div>
<div id="indent-decrement" class="indent-step"></div>
<div id="indent-increment" class="indent-step"></div>
</div>
<div id="busy-indicator">&#9719;</div>
</div>
Expand Down
11 changes: 6 additions & 5 deletions src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ define({
/**
* StatusBar strings
*/
"STATUSBAR_CURSOR_POSITION" : "Line {0}, Column {1}",
"STATUSBAR_INDENT" : "{0} {1}",
"STATUSBAR_SPACES" : "Spaces",
"STATUSBAR_TAB_SIZE" : "Tab Size",
"STATUSBAR_LINE_COUNT" : "{0} Lines",
"STATUSBAR_CURSOR_POSITION" : "Line {0}, Column {1}",
"STATUSBAR_INDENT_TOOLTIP_SPACES" : "Click to switch to spaces",
"STATUSBAR_INDENT_TOOLTIP_TABS" : "Click to switch to tabs",
"STATUSBAR_SPACES" : "Spaces",
"STATUSBAR_TAB_SIZE" : "Tab Size",
"STATUSBAR_LINE_COUNT" : "{0} Lines",

/**
* Command Name Constants
Expand Down
39 changes: 19 additions & 20 deletions src/styles/brackets.less
Original file line number Diff line number Diff line change
Expand Up @@ -134,36 +134,35 @@ a, img {
font-size: 1.4em;
}

#tab-width-label {
/* override default label styles */
color: @bc-grey;
float: none;
font-size: 1em;
line-height: 1;
padding: 0;
width: auto;
#status-indent div {
display: inline-block;
}

#indent-type, #indent-width, #indent-decrement {
margin-right: 2px;
}

#indent-type, #indent-decrement, #indent-increment {
cursor: pointer;
}

#tab-width-label:hover {
#indent-type:hover {
text-decoration: underline;
}

#status-indent div {
display: inline-block;
#indent-decrement, #indent-increment {
width: 4px;
height: 8px;
padding: 0;
cursor: pointer;
}

&.decrement {
background: url("images/stepper-arrow-sprites.svg") no-repeat top left;
margin-right: 2px;
}

&.increment {
background: url("images/stepper-arrow-sprites.svg") no-repeat top right;
}
#indent-decrement {
background: url("images/stepper-arrow-sprites.svg") no-repeat top left;
}

#indent-increment {
background: url("images/stepper-arrow-sprites.svg") no-repeat top right;
margin-right: 0px;
}

#editor-holder {
Expand Down

0 comments on commit 9480d70

Please sign in to comment.