mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 18:57:01 +00:00
Merge pull request #1703 from nasa/text-size-1496
Text size control for text and telemetry elements
This commit is contained in:
commit
6d52f094d9
@ -52,6 +52,7 @@
|
||||
font-size: 0.8rem;
|
||||
$p: 1px;
|
||||
line-height: 100%;
|
||||
overflow: hidden;
|
||||
&.l-static-text {
|
||||
padding: $p;
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ $pad: $interiorMargin * $baseRatio;
|
||||
height: $btnStdH;
|
||||
line-height: $btnStdH;
|
||||
padding: 0 $pad;
|
||||
vertical-align: top;
|
||||
|
||||
&.labeled:before {
|
||||
// Icon when it's included
|
||||
|
@ -309,9 +309,8 @@ textarea.lg { position: relative; height: 300px; }
|
||||
}
|
||||
}
|
||||
&:before {
|
||||
//@include contextArrow();
|
||||
pointer-events: none;
|
||||
color: rgba($colorSelectFg, percentToDecimal($contrastInvokeMenuPercent));
|
||||
color: rgba($colorInvokeMenu, percentToDecimal($contrastInvokeMenuPercent));
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: $interiorMargin; top: 0;
|
||||
|
@ -240,7 +240,9 @@ body.desktop .pane .mini-tab-icon.toggle-pane {
|
||||
.top-bar .buttons-main .s-button,
|
||||
.top-bar .s-menu-button,
|
||||
.tool-bar .s-button,
|
||||
.tool-bar .s-menu-button {
|
||||
.tool-bar .s-menu-button,
|
||||
.tool-bar .select,
|
||||
.tool-bar .input-labeled {
|
||||
$h: $btnToolbarH;
|
||||
height: $h;
|
||||
line-height: $h;
|
||||
|
@ -20,6 +20,7 @@
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
.tool-bar {
|
||||
font-size: 0.7rem;
|
||||
&.btn-bar {
|
||||
white-space: nowrap;
|
||||
}
|
||||
@ -30,9 +31,7 @@
|
||||
input[type="search"],
|
||||
input[type="number"] {
|
||||
box-sizing: border-box;
|
||||
font-size: .8em;
|
||||
height: $btnToolbarH;
|
||||
margin-bottom: 1px;
|
||||
position: relative;
|
||||
&.sm {
|
||||
width: $btnToolbarH;
|
||||
|
@ -122,14 +122,6 @@ define([
|
||||
"description": "Set border color",
|
||||
"control": "color"
|
||||
},
|
||||
{
|
||||
"property": "color",
|
||||
"cssClass": "icon-T",
|
||||
"title": "Text color",
|
||||
"description": "Set text color",
|
||||
"mandatory": true,
|
||||
"control": "color"
|
||||
},
|
||||
{
|
||||
"property": "url",
|
||||
"cssClass": "icon-image",
|
||||
@ -145,6 +137,27 @@ define([
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"property": "color",
|
||||
"cssClass": "icon-T",
|
||||
"title": "Text color",
|
||||
"description": "Set text color",
|
||||
"mandatory": true,
|
||||
"control": "color"
|
||||
},
|
||||
{
|
||||
"property": "size",
|
||||
"title": "Text size",
|
||||
"description": "Set text size",
|
||||
"control": "select",
|
||||
"options": [9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 30, 36, 48, 72, 96].map(function (size) {
|
||||
return { "name": size + " px", "value": size + "px" };
|
||||
})
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
@ -212,11 +225,7 @@ define([
|
||||
"control": "numberfield",
|
||||
"description": "Resize object width",
|
||||
"min": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"items": [
|
||||
},
|
||||
{
|
||||
"property": "useGrid",
|
||||
"name": "Snap to Grid",
|
||||
|
@ -21,7 +21,7 @@
|
||||
-->
|
||||
<div
|
||||
class="l-fixed-position-text l-telemetry"
|
||||
ng-style="{ background: ngModel.fill(), 'border-color': ngModel.stroke(), color: ngModel.color() }"
|
||||
ng-style="{ background: ngModel.fill(), 'border-color': ngModel.stroke(), color: ngModel.color(), 'font-size': ngModel.size() }"
|
||||
>
|
||||
<span
|
||||
class="l-elem l-value l-obj-val-format"
|
||||
|
@ -21,7 +21,7 @@
|
||||
-->
|
||||
<div
|
||||
class="l-fixed-position-text l-static-text"
|
||||
ng-style="{ background: ngModel.fill(), 'border-color': ngModel.stroke(), color: ngModel.color() }"
|
||||
ng-style="{ background: ngModel.fill(), 'border-color': ngModel.stroke(), color: ngModel.color(), 'font-size': ngModel.size() }"
|
||||
>
|
||||
{{ngModel.element.text}}
|
||||
</div>
|
||||
|
@ -58,6 +58,19 @@ define(
|
||||
*/
|
||||
proxy.text = new AccessorMutator(element, 'text');
|
||||
|
||||
/**
|
||||
* Get and/or set the text size of this element.
|
||||
*
|
||||
* @param {string} [size] the new text size (if setting)
|
||||
* @returns {string} the text size
|
||||
* @memberof platform/features/layout.TextProxy#
|
||||
*/
|
||||
proxy.size = new AccessorMutator(element, 'size');
|
||||
|
||||
if (proxy.size() === undefined) {
|
||||
proxy.size("13px");
|
||||
}
|
||||
|
||||
return proxy;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,8 @@ define(
|
||||
y: 2,
|
||||
width: 42,
|
||||
height: 24,
|
||||
fill: "transparent"
|
||||
fill: "transparent",
|
||||
size: "20px"
|
||||
};
|
||||
testElements = [{}, {}, testElement, {}];
|
||||
proxy = new TextProxy(
|
||||
@ -50,6 +51,20 @@ define(
|
||||
expect(proxy.fill('#FFF')).toEqual('#FFF');
|
||||
expect(proxy.fill()).toEqual('#FFF');
|
||||
});
|
||||
|
||||
it("provides getter/setter for text size", function () {
|
||||
expect(proxy.size()).toEqual('20px');
|
||||
expect(proxy.size('12px')).toEqual('12px');
|
||||
expect(proxy.size()).toEqual('12px');
|
||||
});
|
||||
|
||||
it("defaults to 13px for unspecified text size", function () {
|
||||
testElement = {x: 1, y: 2};
|
||||
proxy = new TextProxy(testElement, 0, [testElement]);
|
||||
|
||||
expect(proxy.size()).toEqual('13px');
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user