I am aware of style in OpenOffice.org
< office:automatic-styles > .... < office:automatic-styles />
but
I want inline style same like HTML style,
like
< text:span style="color:" >< /text:span > (something like that)....is this possible?
if you know such example or article then please ref me.
For LibreOffice 4 (probably applies to earlier versions and/or OpenOffice too):
Code:
In styles.xml: in <office:styles>
<style:style style:name="STYLE_NAME" style:family="text">
<style:text-properties style:font-name="DejaVu Sans Mono1" ... />
</style:style>
In content.xml:
<text:span text:style-name="STYLE_NAME">abc def ghi jkl</text:span>
WYSIWYG:
Apply styles on a standard text and select it
Open Styles and Formatting (from Format menu -> Styles and Formatting or press F11)
Switch to Character Styles tab (second one, with "a")
Use last button or the right side, New Style from Selection
Whenever you select text, currently used inline style will be highlighted in Styles and Formatting window. To apply a style, select text and double-click the style in the Styles and Formatting window.
Sorry the answer comes so late, I was just wondering myself and eventually found a solution.
Discovered this and led me to more user-friendly solution in newer version 6.x
At the top of the Styles panel (sidebar), the default selection is Paragraph styles.
Selct the adjoining Character Styles, and you have access to creating, modifying and applying inline styles.
Related
I am using VS 2019 with a black background editor. The List, Seq etc. methods are black and I cannot see them. Please see the attached image. What is the setting that controls the color of these methods? There is a setting 'Symbol-Static' (under Options -> Fonts and Colors -> Show Settings for: Text Editor) but Item foreground and background are disabled. The extension of the file is fsx.
Thanks
You can set the color under Text Editor | Fonts and Colors: F# Functions / Methods. By the way, the module can also be set under User Types: Modules. So for example:
Is set to purple in:
Looks like a default from a light theme is being picked up.
Here such identifiers are using the Plain Text colour (but then, here, so is the the function name and its parameter identifier).
Do you have any extensions that may be adding extra syntax colouring?
Additional
As noted by s952163 the color setting "F# Functions / Methods" is more specific. But it also sets the method names that are shown differently in your screenshot.
Resharper adds lots of extra settings, one of these could easily be changing static methods (maybe across languages), but I do not use Resharper in part because it was too much effort to change all the defaults I disagreed with!
I have a project I am working on in Ionic and the client has asked if the font size can be reduced on the select inputs.
This is a random picture from Google, but shows the select 'scroller' on iOS that I am referencing:
The blue, green and red options are what need smaller font size. I'm pretty sure that it can't be done, easier for me too.
You dont state which version of ionic you are using, so i will assume it is the latest version.
Each component in ionic has assigned sass variables which can be used to target the specific element of the component which can then be used to style it accordingly.
In your theme/variables.scss file you can target a variable which will then override the default style. In your case that would be the font size of the select. Now for this use case the font size is an inherited property and does not have a specific sass variable assigned to it ( you can view all the sass variables for the select here)
So in that case to override the default styles you have to explicitly wrap your scss code with
.ios,.md,.wp{
// your style here
}
From your image it looks like you are using the "action sheet select" style. which would target .action-sheet-ios .action-sheet-button class to change the font size.
.ios{
.action-sheet-ios .action-sheet-selected,
.action-sheet-ios .action-sheet-button{
font-size:1rem;
}
}
This targets ios specifically.
this can be done through css. first serve your app through the lab
ionic serve --lab
Than inspect element from chrome and select your text component and find its class. and Then you can add your custom CSS Styling.
Cheers :D
I'm developing an extension for Firefox which searches terms in a page. And I'd like to change found text highlight color and background. For example, I search for a letter "s" and by default it's selected with a blue rectangle with white text color. So I want to change the blue to the red.
How could I do this via JS?
Edit0:
To select a found text I use document.createRange() and selection.addRange() methods.
I don't know how the default finder selects a found term and applies background to it.
So maybe the 'range' method is not the best.
But I think I'm searching a way to highlight this created range...
Edit1:
Now I've partially resolved the color-changing preoblem. Just add a CSS rule with ::-moz-selection and red background when a text is found and selected. Then for document 'onmousedown' I remove this rule not to leave the default selection as red.
But a new problem is when I find say a digit and it gets a selection the background of that selection is gray (so it looks like a text selection of an inactive window). Then when I click with my mouse somewhere in the document text and press F3 the extension finds the next digit and selects it with the red background. And next findings work right (with red background).
So my purpose is change that initial gray background to red.
Maybe I should change the inactive selection color...
Edit2:
Now I updated my JS code:
var selection=w.getSelection()
var range=w.document.createRange()
range.setStart(foundNode,foundOffset)
range.setEnd(foundNode,foundOffset+foundLength)
selection.removeAllRanges()
selection.addRange(range)
var controller=gBrowser.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsISelectionDisplay)
.QueryInterface(Ci.nsISelectionController);
controller.setDisplaySelection(controller.SELECTION_ATTENTION)
controller.repaintSelection(controller.SELECTION_NORMAL)
Thanks to Noitidart's answer I found some information on how to use nsISelectionController XPCOM interface to select found text with background. Still I can't set a custom color for this background so that it be different from the default color of found text in Firefox. But setting the ui.textSelectBackgroundAttention preference in about:config to desired color will work with both my extension and default find engine.
I've found that SELECTION_ATTENTION constant is responsible for that background color and the setDisplaySelection method links the color to the selected text. But I couldn't find any implementation of this method. I saw only nsISelectionController idl file with its structure but no correspondent .cpp or .js file implementing this .idl. So I don't have information on how the color is set.
Edit3:
Recently I added the "Highlight All" functionality to my extension. And a new question about color of this highlight has rised. Using the above tecnique will show all the matches with green find color (by default). But it's more comfortable to use a different color to distinguish the current match and others.
So I couldn't find another helpful nsISelectionController constant for the "Highlight All" selection. I simply set this selection to 'DISABLED' type and changed the ui.textSelectBackgroundDisabled about:config pref. This pref is obviously for the selected text background of an inactive window. And it worked for me.
controller.setDisplaySelection(controller.SELECTION_DISABLED)
Another thing is that I'm not sure that the controller.repaintSelection() in the previous Edit is necessary. I guess the selection didn't work without it when I started my experiments with this stuff. But now I removed that line and all still work.
Plus:
And some additional links if somebody will need:
nsISelectionController Reference
Selection Reference
Forum question about highlight
about:config prefs for highlight
An Add-on using a similar tecnique
Finder.jsm and other sources
Also I used some files from Firefox source archive: Firefox 33 Source:
- nsISelectionController.idl [\content\base\public\]
- nsTypeAheadFind.cpp [\toolkit\components\typeaheadfind\]
- Finder.jsm [\toolkit\modules\]
- findbar.xml [\toolkit\content\widgets\]
I asked this question to quicksilver via email and this is what he told me:
You might find this one helpful: https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsISelectionController
I'm hardly the master you think I am, actually. :) To change those colors I just change the values for preferences:
ui.textHighlightBackground
ui.textHighlightForeground
ui.textSelectBackgroundAttention -> SELECTION_ATTENTION, it's not a highlight, it's a normal selection (as you would select some text with your mouse and it would turn the regular blue blackground, in windows at least) but it's given "attention", so it has the green background that the find operation reports. Basically it's a way of showing the user "Here I am!!" after firefox automatically selecs the text he searched for.
And I really don't know most of those contants, SELECTION_NORMAL is for normal text selection, like it would be when you select text with your mouse, SELECTION_FIND is for the highlights, and I only know the ON/HIDDEN/OFF/DISABLED ones which are self-explanatory. SELECTION_SPELLCHECK is probably for the auto-correct when you are typing in an editable content node, but I'm just guessing that one from the name.
Also, as far as I know, it's not possible to just create custom selection ranges/contants, as the code simply won't recognize them without editing the C++ code as well. Which is actually one of the reasons I haven't implemented https://github.com/Quicksaver/FindBar-Tweak/issues/76 yet.
The default settings of a text field allow content of a different font and font size to be pasted into the field. How do I make sure that pasted content is converted to use a specific font and font size, i.e. the one I choose as default for the field?
You need to trap the paste from happening, then replicate it yourself. For example in a field (untested):
on pasteKey
put the clipBoardData["text"] into char (word 2 of the selectedchunk of me) to (word 4 of the selectedchunk of me) of me
end pasteKey
You also need to care about drag & drop:
on dragDrop
put the dragData["text"] into char (word 2 of the dropChunk) to (word 4 of the dropChunk) of me
end dragDrop
If you use the "paste" command, it will not trigger the pasteKey message, so if you have such code in your app, so you need to make sure to handle special cases there.
Note: Testing this in the IDE can be tricky, because it interrupts some messages, including pasteKey (use "suspend development tools" from the "development" menu).
I have the following code snippet for creating an input field for entering colors:
DataSourceTextField colorField =
new DataSourceTextField(ZoneDto.ATTR_COLOR, "*localized name*", 7, true);
colorField.setEditorType(new ColorPickerItem());
colorField.setPrompt("*localized instructions*");
This works quite well, since the input field has the localized instructions in its tooltip, but the small square that opens the color picker window has the original english tooltip ("Click to select a new color").
How could I change this message to a localized one?
Is this even possible to accomplish? I read that setEditorType only sets a template, from which instances are generated whenever needed. This means it's not going to work if I add setPrompt("localized instructions") to the ColorPickerItem given to the setEditorType().
Thanks in advance!
If i get you right, why not fill a variable 'localizedStringForColorPicker' with the current selected localization upon startup. And change it, when another localization is selected?