I want to set an icon for the program main window. I found this page https://www.red-lang.org/2016/03/060-red-gui-system.html which says:
Icons and other "resources" are now supported for inclusion in Windows executables. They can be set from Red's main script header, these are the currently supported options:
Icon: file! or block! of files
If no Icon option is specified, a default Red icon will be provided.
I don't get if I need to do it in the program declaration or elsewhere
Red [
needs view
icon %icon1.ico
]
; this doesn't seem to work but it also doesn't break the program
I have also tried putting the icon line in the block defining the view but it is breaking the program.
The right syntax is:
Red [
needs: view
icon: %icon1.ico
]
Also the program needs to be compiled (e.g. red -c -t windows program.red). If the program is launched as a script (do %program.red in red console app) the icon will not be picked up.
Related
I'm working on a simple extension to color the Top Panel using a color specified in a local config file. I know that you can override Gnome Shell Styles by adding rules to stylesheet.css, however this seems to be for rules that are statically known and not determined at runtime. I would like to override the Shell's #panel background style with the color that extension.js reads from a file, is this possible in Gnome JavaScript?
I have the following graphs/outputs from VSCode, VSCode-Insiders and Jupyter Lab respectively.
VSCode
VSCode-Insiders
Jupyter Lab
I want to change the looks of the slider that you see at the bottom.
Basically I want to remove the text and number and change the looks of the slider knob and its position to be in the center relative to the image.
My thought process is that, since VSCode is an electron app and Jupyter Lab runs in a browser so it should be possible to modify that single output cell with a custom targeted CSS.
As an example I have the following that works perfectly in all 3 setups and changes the CSS of the output cell by coloring the text, which tells me that it may be possible to do what I want with the slider element too -
%%html
<style>.css-example { color: darkcyan; }</style>
<span class='css-example'>This text has a nice colour</span>
But in my case I have to target a particular element - "slider". I toggled to the developer mode in VSCode and VSCode Insiders - "Ctrl+Shift+I" or "Help -> Toggle Developer Tools". But I am not able to select the slider element using the "Inspector".
In Jupyter Lab fortunately I was able to select the slider element, but the class vega-bind (the div that has the slider has a class called vega-bind) doesn't seem to have any CSS in it - at least nothing related to vega-bind showed up in the Developer Tool.
Is there any way to achieve what I am trying to do in Jupyter Lab and VSCode Jupyter Notebooks?
The following code generates that output that you see above -
Requirements - altair, pandas and numpy
import altair as alt
import pandas as pd
import numpy as np
rand = np.random.RandomState(42)
df = pd.DataFrame({
'xval': range(100),
'yval': rand.randn(100).cumsum()
})
slider = alt.binding_range(min=0, max=100, step=1, name='cutoff')
selector = alt.selection_single(bind = slider, init={'cutoff': 50})
alt.Chart(df).mark_point().encode(
x='xval',
y='yval',
color=alt.condition(
alt.datum.xval < selector.cutoff,
alt.value('red'), alt.value('blue')
)
).add_selection(
selector
)
Turns out Jupyter Notebooks in VSCode are rendered as iframes and are separate processes that you cannot debug/run developer tools on from the main developer tools panel that opens on the side.
To find the CSS, HTML etc of the notebook iframe, you have to open the Webview Developer Tool and you can do that by typing Open Webview Developer Tools in the command palette i.e.
CTRL+Shift+P -> Open Webview Developer Tools
Now you can select the inspector and hover over any element you like and see/edit its CSS.
Downloaded the zip file and unzipped it into my CSS folder. All files were shown in a green font, so I used the properties dialog box to remove the encryption.
Added the reference to my html document:
<link rel='stylesheet' href="css/foundation-icons.css" />
Used an icon with the <i class="fi-[icon]"></i> suggested language.
The icon takes up space. It is in a button, so I can see the button get wider to accommodate it. But I don't see the icon itself, regardless of color or size setting. What's wrong?
The preview file works. But there was no instruction document that others have mentioned. Also, why in the preview file does it show not only the class but also what looks like an html entity, such as ?
I'm using an icon font and everything works so far as the icons show up in the interface as they should. I'm creating the file via Sass using the .scss format.
I noticed when I inspect an element to view it's CSS properties in the code inspector, or view the style sheet via the code inspector, or just open the .css file in my text editor, it shows the Unicode character of the icon glyph as follows:
.icon-alert::before {
content: "" !important;
}
What causes the little box with the question mark instead of what's actually written in the .scss file: \e669
How can I fix this?
I cannot mark this duplicate yet but there are existing posts around this topic. You have to create a function to workaround a known bug:
Sass: unicode escape is not preserved in .css file
https://github.com/sass/sass/issues/1395
I am making Dashing widget to show statistics from Jenkins CI server.
I want to set Jenkins logo icon as a widget background icon. For the moment Jenkins logo icon is not included into official Font Awesome(https://github.com/FortAwesome/Font-Awesome/issues/3714, https://github.com/FortAwesome/Font-Awesome/issues/1529).
Dashing framework is flexible and I assume there must be a solution to set a custom icon as a widget background. But for now I cannot solve the issue on my own.
Has anyone come across this?
The following code from the Bamboo widget will likely do the trick. This is only needed in the scss file, there shouldn't be anything else special needed (other than having the file in the correct location for the scss to find it!)
.widget-bamboo-build {
background: url("/assets/bamboo-logo.png") no-repeat center;
This line is right at the top of the widget section in the scss file. I've included the .widget-bamboo-build line to indicate that.
So this line looks in the Dashing applications home directory for a folder called 'assets' and then tries to find 'bamboo-logo.png' in that folder.
Hope this helps :)