GtkLabel use markup while keeping CSS styling - gtk

I have a GtkLabel with which I have setup a hyperlink using the <a> tag in the label's markup however doing so negates any styling my GtkCssProvider sets. How can I continue to allow CSS to style the text in the label while also making it a hyperlink?

to style all the text you could try
GtkLabel *{
color : red;
}
this selects pretty much selects everything in gtk labels(like all states) and applies the css style to all of it.
to Style only the link part select the subnode "link"
label link{
color : red;
}

Related

TINYMCE - Paste Plugin: How to modify styles from Word Document

My word document has some text that has a particular font applied, ex. Arial and is bolded
When I paste into TinyMCE, I get that value in a span:
<p><strong><span style="font-family: 'Arial'>Hello World</span>/strong>/</p>
How do I detect that this line of text has both Bold and Arial applied so that I can convert it to use a custom tag called BoldArial:
<p><BoldArial>Hello World</BoldArial></p>
I would like to apply styling to BoldArial in my custom stylesheet that I have included with TinyMCE upon initializing it, ex:
p.BoldArial {
font-size: 11px;
font-family: Arial;
font-weight: bold;
}
How can I use the paste plugin to convert MSWord Styles to custom CSS?
You can't do that with a simple paste.
You could code the html in Word and paste as text into the Text Tab of TinyMCE.
So in Word you would have your paragraph already coded:
<p><BoldArial>Hello World</BoldArial></p>
To add the html, you could use search/replace to get 90% of the way there.
Instructions
Cntrl+H to open 'Find and Replace
Use Wildcards
Find what:
?*^13
Replace with:
<p class = "BoldArial">^&</p>
For 'Find', set 'Font' to 'Bold'
You will need to cleanup the newline/return manually. See pic.

how to add an empty (or default) Selection to font_formats and fontsize_formats?

in the configuration of tinyMCE I define some font selection:
font_formats: "Calibri=calibri,sans-serif; Arial=arial,sans-serif; Times New Roman=times new roman,sans-serif",
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt",
now the user can mark some text and assign a special font or a special fontsize to the marked text.
I would like the user to be able to undo this again. That means, later the user should be able to mark
this text again and to assign "no special font" or "no special fontsize" to the marked text.
But in the selection of font and fontsize there is no empty item and no "default"- item.
How can I add this to these font-select-boxes?
(I use tinyMCE 4.1.10)
You can add the Clear Formatting toolbar button by adding this to the toolbar in your init:
toolbar: '... | removeformat | ...'
...this will add a button that will clear formatting from the selected text (including formatting added via the two options you reference).

Text/Code highlight with jsDoc

jsDoc seems to support most of the MD syntax, but when it comes to highlighting a single reserved word or text, I cannot find a usable tag for that.
In the MD syntax I can use `word`, which would set a grey background and a different font, so you can see it clearly, same as on StackOverflow - word.
In jsDoc, whether I use `word` or <code>word</code>, the effect is just setting italic style to the word, which cannot be clearly seen as a reserved word.
Is there any syntax in jsDoc to clearly highlight a word or a text string, like `some text` in MD, to look like some text?
Alternatively, is there a way to customize it - provide my own CSS for a standard MD tag?
JSDoc documentation seems to be using <code> tag, and it highlights the text using a grey background like you want by setting it on the code tag properties defined on the usejavadoc.css file:
From http://usejsdoc.org/tags-name.html:
There is a guide on how to edit or create your own JSDoc template, with a section on how to override the default template layout file:
http://usejsdoc.org/about-configuring-default-template.html#overriding-the-default-template-s-layout-file
But for something as simple as this, you don't even have to go that far. Just edit the css fragment, before or after generation, and set the background-color you want for the code tag. You may do it before generation by editing this line and setting the background color you want:
https://github.com/jsdoc3/jsdoc/blob/5a58bdf5a551844f12b46be6436aefd3c41e0393/templates/default/static/styles/jsdoc-default.css#L257
Or, if that doesn't work, overriding the property by adding
code {
background-color: #DEDEDE !important;
}
to the file.
As an alternative you can use a framework like qooxdoo to generate your documentation using JSDoc-like comments. According to their API reference you may use <pre class="javascript"> for inline javascript syntax code highlighting, and it looks pretty nice: http://manual.qooxdoo.org/3.0/pages/development/api_jsdoc_ref.html#html

Gtk3 label line spacing

Is there any way to specify spacing between lines of text in multiline Gtk3 Label, as with CSS line-height property? This CSS property does not work and I can't google out anything else.
I found the solution using Pangoattribute on label
<br>PangoAttrList *attr_list;</br>
<br>PangoAttribute *attr;</br>
<br> attr_list=pango_attr_list_new();</br>
<br>attr=pango_attr_rise_new (20000);</br>
<br>pango_attr_list_insert(attr_list,attr);</br>
<br>gtk_label_set_attributes(GTK_LABEL(label),attr_list);</br>

Smartgwt font size in text input using css

When I put this in my css file:
label, input
{
font-size: 18px;
}
Text labels show up with font size 18, but text boxes aren't affected.
Also, when looking at the generated html code in the browser (Inspect element, using Chrome), I'm seeing that the input box has a set height.
So the question is, can I control the size of the text box and the size of the font inside the text box using just css?
If you add the !important declaration your css would take precedence on the smartgwt css declaration.
I've just tried and it works.
label, input {
font-size: 18px !important;
}