(KDE4) Plasma::TextEdit.nativeWidget()->setHtml() does not accept a colors - qtextedit

I have a plasmoid-application which utilises an objects of the Plasma::TextEdit class. And now I could to colorize a text in this objects. I had tried to do this:
m_text->nativeWidget()->setHtml("<font color=\"#777777\">some text</font><br/>other text");
with a couple of variants (like using the span tag with the stile attribute instead of the font, using the red color name instead the #777777), but result was the same.
Any ideas?

It looks like the "bug" was not in the programming: it turns out that there was need to restart the KDE.
Does anybody know why this happens? And what may I do to "flush" some cache or something else in order that the KDE picks a new version of my plasmoid up?

Related

Xcode SwiftUI modify extension variable

I have an extension of Color that stores a colour variable. I am currently using this to set the main colour for the whole app, which currently works.
extension Color{ static var colour: Color = Color.red }
If I set it to red everything turns red. But at the moment I have to hard code what colour it will be. I want to be able to modify this colour during runtime.
I have tried to modify the extension at runtime but I can’t seem to get it working and I’m not sure if it allows you to do this. I’m not sure the best way to approach this.
If anyone has anyway of changing the variable in an extension that would be ideal but if there’s another way, any help would be greatly appreciated. If you have any questions or I haven’t explained something clearly ask away.
Thanks so much

What system color to use to highlight required fields in delphi/windows

a bit background
I am currently using the clHighlight color together with a StyleServices.GetSystemColor call to set the background color of controls that are:
not focused
have a NULL value (field.IsNull=True)
and are about a required field (field.required=True)
Its not about how to do the highlighting itself, I figured that out already.
Currently I am using system color clHighlight, but this makes confuses my users as they think the entire contents of the field is selected (see screenshot).
But I also have style support implemented, so using a custom predefined color is not really what I am looking for. after googling a bit I found quite a list here https://learn.microsoft.com/en-us/dotnet/api/system.windows.systemcolors?view=netframework-4.7.2 but I am unable to find what I am looking for.
Using RAD studio Rio 10.3.1 Enterprise.
The actual question
So - what system color should I use? (not really looking for subjective suggestions, but for a more or less "officially recommended" constant to use.)
a screenshot
Answer: There is no more or less system color constant defined for this specific purpose.
Solution/workaround:
Thanks all for the suggestions. I decided to go for the clInfoBk constant (background color for hint windows), this looks far less confusing. One could interpret the color as a "hint" for fields that need to be filled out.
And it looks like this, in the default color scheme:

Vim airline customise settings

In this screenshot of my vimrc settings, I have installed the plugin vim-airline using vundle. After going through airlines docs, I found the set of lines to customise my airline.
The problem is the ones highlighted in red. The blue highlighted one works fine but the red one does not. The left one is same as right one. I tried using different Unicode symbols but does not work. Any workaround to this situation as this is troubling my OCD :P.
Thanks in advance.
This is a well-known issue related to the font (size and family) used in your terminal.
For a better display, you have two solutions:
Do not use arrows as separators
Configure your terminal emulator to use a patched font with the right size
If you prefer the first solution, make sure you have this code in your .vimrc:
let g:airline_right_sep = ""
let g:airline_left_sep = ""
If you prefer the other solution, take a look at this: https://github.com/powerline/fonts
I have used the Hack font with size 11 for a long time and the arrows are perfectly displayed in my editor...

BitmapFont in Skin doesn't draw labels correctly

I made a bitmap font using Hiero, called default.fnt and default.png. I can use these as a BitmapFont in LibGDX, and draw text with the font without problems, using font.draw(). But I can't use this font as the default font in a Skin. I've used the uiskin.json file from here(along with the rest of the skin, but I deleted the Droid Sans files before making my own font), because I have no idea how to make one of my own. From what I've read on the Internet, the .json file is correctly set up: it has the line com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } }, which should make the default.fnt the default font for widgets that use the skin. Still, when I run the program, I see this:
There should be a label above the buttons, and the buttons should have text.
If I do this: startGameButton.getStyle().font = font;, where startGameButton is one of the buttons, and font is the BitmapFont created like this: font = new BitmapFont(Gdx.files.internal("uiskin/default.fnt"), Gdx.files.internal("uiskin/default.png"), false);, the buttons shows the text properly. I don't want to do this since it feels too much like a hack.
I'm following this tutorial, but I've had to look some things up in later revisions of his code, because LibGDX has changed since it was written.
MenuScreen.java(the screen where there are problems)
AbstractScreen.java
Also please tell me if there's a better way to make the menu UI, or if you need other files. The uiskin.json is linked above.
Thank you.
I fixed it. The Droid Sans bitmap image existed in two places, it was part of uiskin.png too. I don't know how, but it probably read the font's letters from that file instead of default.png. So in the end I just renamed the font's .fnt and .png(and the file parameter in the .fnt) and did a search-replace inside the skin's .json, and it all works fine now. I don't know exactly what caused it, but maybe default-font is a reserved word or something.
Anyway, it works now. Thanks to Jyro117 for making me think maybe I shouldn't replace the default but add my own font.

Customize List's cells in DashCode

I have my site created with Dashcode and I am using the List object but I don't like the default blue background when a cell is selected.
How can I customize this? For example change it to grey or white, etc.
(As far as i know, everything is customizable in Dashcode, is just sometimes you have to do it using code and not Dashcode UI.)
Thanks in advance.
Answer to my self:
looking at main.css I found something like:
.listRowTemplate_template.selected {
background-color: rgb(56, 0, 217);
}
Which is the color I want to change ;)
Which would have been my answer, shall i vote you up? ;-)
It is easy to forget that when in Dashcode it is "just" JavaScript, CSS and HTML and so many problems will often succumb to those type of solutions such as you have done.

Resources