How do I set a background colour for QTextBrowser?? (PyQt) - pyqt

I have created a QTextBrowser and I wanted to know how i would set the background colour of the whole widget.
I have tried QTextBrowser.setBackground(QtGui.QBrush(QtCore.Qt.blue, QtCore.Qt.SolidPattern)) with no luck.

In this case I suggest you to use stylesheet:
If in QDesigner, right click on the control, click "Set Stylesheet" and write
background-color: blue;
If you want to do it by code, just use
YourControlTextBrowser.setStyleSheet("background-color: blue;")

Related

How to specify the background color of a page?

I don't understand how to specify the background color of a given page.
In app.json, I have the following:
"window":{
"backgroundColor": "#ff0000"
}
This color is applied in the very background, I can see it if i try to scroll the page with my finger.
But my views are still white.
I tried to simply add the background color of my view and it is mostly working, but the last view is not expanding to the bottom of the screen, so I still have a white area.
How can I either:
Request all the view to be transparent so that I can see the background color specified in app.json
Create a view which expand to the bottom of the page, without creating a scrollbar
There is a root element in Wechat Mini-program named page.
So the following code will make the work:
page
{
background-color: red;
}

How do I make a button transparent

I am making a javafx application where there's a border pane with a background image. The buttons on this border pane are supposed to be transparent. I can't seem to be able to accomplish this using blend modes and I can't. Please help me!!!
Sorry I can't post the code
css :
.button{
-fx-background-color: transparent;
}
Javafx code :
Button buttonColor = new Button("Color");
buttonColor.setStyle("-fx-background-color: transparent;");
you can simply using
button.setVisible(false);
to make it transparent, if you want to make it appears again, just using
button.setVisible(true);

Move the CKEditor inline toolbar

I'm using CKEditor 4 inline. Is it possible to change the toolbar location e.g. 50px over the editor div?
Thank you!
If you want to keep this "floating toolbar" behaviour, then you can move it around using these settings.
But if you want to keep toolbar in one place, then check this plugin: http://ckeditor.com/addon/sharedspace
There's a sample, but you need to build a CKEditor package with this plugin and then you'll be able to check it.
You can simply give margin-top: -50px; to the toolbar element if you want to place it 50px over the editor div.
Thanks to Harish, I've found a way to make it work for CKEditor 5: Inline Editor. This is how to move the toolbar relatively from its current position.
.ck.ck-toolbar-container {
margin-top: -24px;
margin-left: 48px;
}

Highlight for Current Menu Item not highlighting correctly

I would like the current menu item to stay highlighted when a user is in that section. I set up styles for .current-menu-item. For some reason some styles work and some don't. I used all of these for testing purposes:
.current-menu-item {
color:#F90;
border-bottom:2px solid #fco;
text-decoration:line-through;
background:#000;
}
Background and Text-Decorationare the only styles that work. Any clues why the others do not? I really only want the text color to stay orange (highlighted #f90).
Thanks in advance for any help :)
sandra :)
Your color rule is likely being overridden by a more specific rule. You can investigate this further, using 'Inspect Element' in google chrome, and looking at the styles in the inspector.

How to remove the dark shadow of the screen when a Dialog is shown?

When a Dialog is shown then the background of screen is darkened. I want to remove this darkness so that the screen looks like normal. How to achieve that ?
When you show a Dialog the background becomes a Form, changing its style you can modify the background of a Dialog. I don´t really know if you can make this Form transparent. I use the LWUIT-Theme creator and modifiying the Form´s style, I can change the background for an image o for one colour.
Try it here!
http://lwuit.java.net/
Set the tint color of the parent form, you can also set this in the look and feel class and within the theme constants in the resource editor.
just add below code on your dialog:
dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);

Resources