[Frontend] Refactoring glyphs to classes

fixes #1047
Very much In-progess, "icon-" selector,
browse bar buttons
This commit is contained in:
Charles Hacskaylo 2016-06-23 08:55:27 -07:00
parent 8b29ccf3af
commit dc670b22a6
8 changed files with 39 additions and 23 deletions

View File

@ -218,7 +218,7 @@ define([
"$window" "$window"
], ],
"group": "windowing", "group": "windowing",
"glyph": "y", "cssclass": "icon-new-window",
"priority": "preferred" "priority": "preferred"
}, },
{ {
@ -226,7 +226,6 @@ define([
"implementation": FullscreenAction, "implementation": FullscreenAction,
"category": "view-control", "category": "view-control",
"group": "windowing", "group": "windowing",
"glyph": "z",
"priority": "default" "priority": "default"
} }
], ],

View File

@ -51,7 +51,8 @@ define(
// based on whether or not we are currently // based on whether or not we are currently
// full screen. // full screen.
var metadata = Object.create(FullscreenAction); var metadata = Object.create(FullscreenAction);
metadata.glyph = screenfull.isFullscreen ? "_" : "z"; //metadata.glyph = screenfull.isFullscreen ? "_" : "z";
metadata.cssclass = screenfull.isFullscreen ? "icon-fullscreen-expand" : "icon-fullscreen-collapse";
metadata.description = screenfull.isFullscreen ? metadata.description = screenfull.isFullscreen ?
EXIT_FULLSCREEN : ENTER_FULLSCREEN; EXIT_FULLSCREEN : ENTER_FULLSCREEN;
metadata.group = "windowing"; metadata.group = "windowing";

View File

@ -172,7 +172,8 @@ define([
], ],
"description": "Edit", "description": "Edit",
"category": "view-control", "category": "view-control",
"glyph": "p" "glyph": "p",
"cssclass": "icon-pencil"
}, },
{ {
"key": "properties", "key": "properties",
@ -182,6 +183,7 @@ define([
], ],
"implementation": PropertiesAction, "implementation": PropertiesAction,
"glyph": "p", "glyph": "p",
"cssclass": "icon-pencil",
"name": "Edit Properties...", "name": "Edit Properties...",
"description": "Edit properties of this object.", "description": "Edit properties of this object.",
"depends": [ "depends": [

View File

@ -1,5 +1,11 @@
@mixin glyph($unicode) { @mixin glyph($unicode) {
&:before { content: $unicode; } &:before {
content: $unicode;
}
}
[class*="icon-"] {
@extend .ui-symbol;
} }
.ui-symbol, .ui-symbol,
@ -8,6 +14,11 @@
&.context-available { @include glyph('\e902'); } &.context-available { @include glyph('\e902'); }
} }
.icon-pencil { @include glyph('\e1024'); }
.icon-new-window { @include glyph('\e1021'); }
.icon-fullscreen-collapse { @include glyph('\e1012'); }
.icon-fullscreen-expand { @include glyph('\e1013'); }
/*************************************** MENUS */ /*************************************** MENUS */
.icon-menu ul li { .icon-menu ul li {
&.i-layers-move-to-top { @include glyph('\e905'); } &.i-layers-move-to-top { @include glyph('\e905'); }

View File

@ -33,24 +33,26 @@
&.type-icon { &.type-icon {
color: $colorObjHdrIc; color: $colorObjHdrIc;
} }
&.icon {
color: $colorKey;
font-size: inherit;
&.alert {
color: $colorAlert;
&:hover {
color: lighten($colorAlert, $ltGamma);
}
}
&.major {
font-size: 1.65em;
}
}
&.icon-calendar:after { &.icon-calendar:after {
content: "\e605"; content: "\e605";
} }
} }
[class^="i-"],
.ui-symbol.icon {
color: $colorKey;
font-size: inherit;
&.alert {
color: $colorAlert;
&:hover {
color: lighten($colorAlert, $ltGamma);
}
}
&.major {
font-size: 1.65em;
}
}
.bar .ui-symbol { .bar .ui-symbol {
display: inline-block; display: inline-block;
} }

View File

@ -121,6 +121,7 @@ $pad: $interiorMargin * $baseRatio;
@extend .ui-symbol; @extend .ui-symbol;
content: '\e901'; content: '\e901';
color: $colorKey; color: $colorKey;
margin-right: $interiorMargin;
} }
&:hover:before { &:hover:before {
color: pullForward($c, 10%); color: pullForward($c, 10%);

View File

@ -19,13 +19,13 @@
this source code distribution or the Licensing information page available this source code distribution or the Licensing information page available
at runtime from the About dialog for additional information. at runtime from the About dialog for additional information.
--> -->
<a class="s-btn key-{{parameters.action.getMetadata().key}}" <a class="s-btn key-{{parameters.action.getMetadata().key}} {{parameters.action.getMetadata().cssclass}}"
ng-class="{ labeled: parameters.labeled }" ng-class="{ labeled: parameters.labeled }"
title="{{parameters.action.getMetadata().description}}" title="{{parameters.action.getMetadata().description}}"
ng-click="parameters.action.perform()"> ng-click="parameters.action.perform()">
<span class="ui-symbol icon"> <!--span class="ui-symbol icon">
{{parameters.action.getMetadata().glyph}} {{parameters.action.getMetadata().glyph}}
</span> </span-->
<span class="title-label" ng-if="parameters.labeled"> <span class="title-label" ng-if="parameters.labeled">
{{parameters.action.getMetadata().name}} {{parameters.action.getMetadata().name}}
</span> </span>

View File

@ -22,9 +22,9 @@
<a class="s-btn" <a class="s-btn"
ng-class="{ labeled: structure.text, structure.cssclass }" ng-class="{ labeled: structure.text, structure.cssclass }"
ng-click="structure.click()"> ng-click="structure.click()">
<span class="ui-symbol icon"> <!--span class="ui-symbol icon">
{{structure.glyph}} {{structure.glyph}}
</span> </span-->
<span class="title-label" ng-if="structure.text"> <span class="title-label" ng-if="structure.text">
{{structure.text}} {{structure.text}}
</span> </span>