Skip to content

Commit dc670b2

Browse files
committed
[Frontend] Refactoring glyphs to classes
fixes #1047 Very much In-progess, "icon-" selector, browse bar buttons
1 parent 8b29ccf commit dc670b2

File tree

8 files changed

+39
-23
lines changed

8 files changed

+39
-23
lines changed

platform/commonUI/browse/bundle.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,14 @@ define([
218218
"$window"
219219
],
220220
"group": "windowing",
221-
"glyph": "y",
221+
"cssclass": "icon-new-window",
222222
"priority": "preferred"
223223
},
224224
{
225225
"key": "fullscreen",
226226
"implementation": FullscreenAction,
227227
"category": "view-control",
228228
"group": "windowing",
229-
"glyph": "z",
230229
"priority": "default"
231230
}
232231
],

platform/commonUI/browse/src/windowing/FullscreenAction.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ define(
5151
// based on whether or not we are currently
5252
// full screen.
5353
var metadata = Object.create(FullscreenAction);
54-
metadata.glyph = screenfull.isFullscreen ? "_" : "z";
54+
//metadata.glyph = screenfull.isFullscreen ? "_" : "z";
55+
metadata.cssclass = screenfull.isFullscreen ? "icon-fullscreen-expand" : "icon-fullscreen-collapse";
5556
metadata.description = screenfull.isFullscreen ?
5657
EXIT_FULLSCREEN : ENTER_FULLSCREEN;
5758
metadata.group = "windowing";

platform/commonUI/edit/bundle.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ define([
172172
],
173173
"description": "Edit",
174174
"category": "view-control",
175-
"glyph": "p"
175+
"glyph": "p",
176+
"cssclass": "icon-pencil"
176177
},
177178
{
178179
"key": "properties",
@@ -182,6 +183,7 @@ define([
182183
],
183184
"implementation": PropertiesAction,
184185
"glyph": "p",
186+
"cssclass": "icon-pencil",
185187
"name": "Edit Properties...",
186188
"description": "Edit properties of this object.",
187189
"depends": [

platform/commonUI/general/res/sass/_glyphs.scss

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
@mixin glyph($unicode) {
2-
&:before { content: $unicode; }
2+
&:before {
3+
content: $unicode;
4+
}
5+
}
6+
7+
[class*="icon-"] {
8+
@extend .ui-symbol;
39
}
410

511
.ui-symbol,
@@ -8,6 +14,11 @@
814
&.context-available { @include glyph('\e902'); }
915
}
1016

17+
.icon-pencil { @include glyph('\e1024'); }
18+
.icon-new-window { @include glyph('\e1021'); }
19+
.icon-fullscreen-collapse { @include glyph('\e1012'); }
20+
.icon-fullscreen-expand { @include glyph('\e1013'); }
21+
1122
/*************************************** MENUS */
1223
.icon-menu ul li {
1324
&.i-layers-move-to-top { @include glyph('\e905'); }

platform/commonUI/general/res/sass/_icons.scss

+15-13
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,26 @@
3333
&.type-icon {
3434
color: $colorObjHdrIc;
3535
}
36-
&.icon {
37-
color: $colorKey;
38-
font-size: inherit;
39-
&.alert {
40-
color: $colorAlert;
41-
&:hover {
42-
color: lighten($colorAlert, $ltGamma);
43-
}
44-
}
45-
&.major {
46-
font-size: 1.65em;
47-
}
48-
}
4936
&.icon-calendar:after {
5037
content: "\e605";
5138
}
5239
}
5340

41+
[class^="i-"],
42+
.ui-symbol.icon {
43+
color: $colorKey;
44+
font-size: inherit;
45+
&.alert {
46+
color: $colorAlert;
47+
&:hover {
48+
color: lighten($colorAlert, $ltGamma);
49+
}
50+
}
51+
&.major {
52+
font-size: 1.65em;
53+
}
54+
}
55+
5456
.bar .ui-symbol {
5557
display: inline-block;
5658
}

platform/commonUI/general/res/sass/controls/_buttons.scss

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ $pad: $interiorMargin * $baseRatio;
121121
@extend .ui-symbol;
122122
content: '\e901';
123123
color: $colorKey;
124+
margin-right: $interiorMargin;
124125
}
125126
&:hover:before {
126127
color: pullForward($c, 10%);

platform/commonUI/general/res/templates/controls/action-button.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
this source code distribution or the Licensing information page available
2020
at runtime from the About dialog for additional information.
2121
-->
22-
<a class="s-btn key-{{parameters.action.getMetadata().key}}"
22+
<a class="s-btn key-{{parameters.action.getMetadata().key}} {{parameters.action.getMetadata().cssclass}}"
2323
ng-class="{ labeled: parameters.labeled }"
2424
title="{{parameters.action.getMetadata().description}}"
2525
ng-click="parameters.action.perform()">
26-
<span class="ui-symbol icon">
26+
<!--span class="ui-symbol icon">
2727
{{parameters.action.getMetadata().glyph}}
28-
</span>
28+
</span-->
2929
<span class="title-label" ng-if="parameters.labeled">
3030
{{parameters.action.getMetadata().name}}
3131
</span>

platform/forms/res/templates/controls/button.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
<a class="s-btn"
2323
ng-class="{ labeled: structure.text, structure.cssclass }"
2424
ng-click="structure.click()">
25-
<span class="ui-symbol icon">
25+
<!--span class="ui-symbol icon">
2626
{{structure.glyph}}
27-
</span>
27+
</span-->
2828
<span class="title-label" ng-if="structure.text">
2929
{{structure.text}}
3030
</span>

0 commit comments

Comments
 (0)