mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 08:25:31 +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;
|
font-size: 0.8rem;
|
||||||
$p: 1px;
|
$p: 1px;
|
||||||
line-height: 100%;
|
line-height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
&.l-static-text {
|
&.l-static-text {
|
||||||
padding: $p;
|
padding: $p;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@ $pad: $interiorMargin * $baseRatio;
|
|||||||
height: $btnStdH;
|
height: $btnStdH;
|
||||||
line-height: $btnStdH;
|
line-height: $btnStdH;
|
||||||
padding: 0 $pad;
|
padding: 0 $pad;
|
||||||
vertical-align: top;
|
|
||||||
|
|
||||||
&.labeled:before {
|
&.labeled:before {
|
||||||
// Icon when it's included
|
// Icon when it's included
|
||||||
|
@ -309,9 +309,8 @@ textarea.lg { position: relative; height: 300px; }
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&:before {
|
&:before {
|
||||||
//@include contextArrow();
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
color: rgba($colorSelectFg, percentToDecimal($contrastInvokeMenuPercent));
|
color: rgba($colorInvokeMenu, percentToDecimal($contrastInvokeMenuPercent));
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: $interiorMargin; top: 0;
|
right: $interiorMargin; top: 0;
|
||||||
|
@ -240,7 +240,9 @@ body.desktop .pane .mini-tab-icon.toggle-pane {
|
|||||||
.top-bar .buttons-main .s-button,
|
.top-bar .buttons-main .s-button,
|
||||||
.top-bar .s-menu-button,
|
.top-bar .s-menu-button,
|
||||||
.tool-bar .s-button,
|
.tool-bar .s-button,
|
||||||
.tool-bar .s-menu-button {
|
.tool-bar .s-menu-button,
|
||||||
|
.tool-bar .select,
|
||||||
|
.tool-bar .input-labeled {
|
||||||
$h: $btnToolbarH;
|
$h: $btnToolbarH;
|
||||||
height: $h;
|
height: $h;
|
||||||
line-height: $h;
|
line-height: $h;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
.tool-bar {
|
.tool-bar {
|
||||||
|
font-size: 0.7rem;
|
||||||
&.btn-bar {
|
&.btn-bar {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
@ -30,9 +31,7 @@
|
|||||||
input[type="search"],
|
input[type="search"],
|
||||||
input[type="number"] {
|
input[type="number"] {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: .8em;
|
|
||||||
height: $btnToolbarH;
|
height: $btnToolbarH;
|
||||||
margin-bottom: 1px;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
&.sm {
|
&.sm {
|
||||||
width: $btnToolbarH;
|
width: $btnToolbarH;
|
||||||
|
@ -122,14 +122,6 @@ define([
|
|||||||
"description": "Set border color",
|
"description": "Set border color",
|
||||||
"control": "color"
|
"control": "color"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"property": "color",
|
|
||||||
"cssClass": "icon-T",
|
|
||||||
"title": "Text color",
|
|
||||||
"description": "Set text color",
|
|
||||||
"mandatory": true,
|
|
||||||
"control": "color"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"property": "url",
|
"property": "url",
|
||||||
"cssClass": "icon-image",
|
"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": [
|
"items": [
|
||||||
{
|
{
|
||||||
@ -212,11 +225,7 @@ define([
|
|||||||
"control": "numberfield",
|
"control": "numberfield",
|
||||||
"description": "Resize object width",
|
"description": "Resize object width",
|
||||||
"min": "1"
|
"min": "1"
|
||||||
}
|
},
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"items": [
|
|
||||||
{
|
{
|
||||||
"property": "useGrid",
|
"property": "useGrid",
|
||||||
"name": "Snap to Grid",
|
"name": "Snap to Grid",
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
-->
|
-->
|
||||||
<div
|
<div
|
||||||
class="l-fixed-position-text l-telemetry"
|
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
|
<span
|
||||||
class="l-elem l-value l-obj-val-format"
|
class="l-elem l-value l-obj-val-format"
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
-->
|
-->
|
||||||
<div
|
<div
|
||||||
class="l-fixed-position-text l-static-text"
|
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}}
|
{{ngModel.element.text}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -58,6 +58,19 @@ define(
|
|||||||
*/
|
*/
|
||||||
proxy.text = new AccessorMutator(element, 'text');
|
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;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,8 @@ define(
|
|||||||
y: 2,
|
y: 2,
|
||||||
width: 42,
|
width: 42,
|
||||||
height: 24,
|
height: 24,
|
||||||
fill: "transparent"
|
fill: "transparent",
|
||||||
|
size: "20px"
|
||||||
};
|
};
|
||||||
testElements = [{}, {}, testElement, {}];
|
testElements = [{}, {}, testElement, {}];
|
||||||
proxy = new TextProxy(
|
proxy = new TextProxy(
|
||||||
@ -50,6 +51,20 @@ define(
|
|||||||
expect(proxy.fill('#FFF')).toEqual('#FFF');
|
expect(proxy.fill('#FFF')).toEqual('#FFF');
|
||||||
expect(proxy.fill()).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…
x
Reference in New Issue
Block a user