How can I replace the icons used in Vaadin Flow components (calendar, upload etc) with my own icons? Is that even possible? I didn't see anything in component's API and it looks like the icons are font icons instead of the usual iron-icon.
Yes, the component icons are implemented using font icons. The main reason was that they should be customizable with a theme (CSS), which seemed impossible using iron-icon. Eventually we want to transition to using SVGs for the component icons as well.
So, to customize the component icons, you need to write a component style sheet, where you change the icon. You can either create your own icon font, or use a CSS background image. The latter option has the downside of not being able to change color easily, without swapping the whole image.
As an example, here’s what you’d write for the vaadin-date-picker component (assuming that’s what you meant by “calendar”).
[part="toggle-button"]::before {
content: ""; /* Remove the existing font based icon */
background-image: url(...); /* data uri */
}
Use a base64 encoded data uri, so that you don’t have to worry about using relative or absolute paths for the image.
To use that style sheet in your Flow-based app, place CSS file in the frontend folder in your app, and add the following:
#CssImport(value = "my-styles.css", themeFor="vaadin-date-picker")
Related
I have found "Material Design Iconic Font" library which is similar to md-icon and allow to create a stacked icon:
http://zavoloklom.github.io/material-design-iconic-font/examples.html
But wasn't able to create a stacked icon combining angular material icons.
https://material.angularjs.org/latest/api/directive/mdIcon
I'm already using angular material icons in my project, and don't want to include another library just for stacked icon.
Is there any way/work around we can combine md-icons to create a stacked angular material icons?
I laso had this problem once, if you want to do that you will need to use CSS for that.
Create 2 icon tags, put them in a container tag, and give this container a class.
Now you need to use CSS to stack the icons.
(you might want to set the position of the 3 tags to relative so they stack easily).
I'm trying to change the color used when elements of the MetropolisUIBlack.Style XE5 style (Firemonkey). It seems that, in order to do so, the simplest way would be to edit the PNG image that contains all these elements i the style (MetroBluestyle.png).
Unfortunately, I can't find a way to save the PNG that is contained in the style element to a file so I can manipulate it safely and reload it once the color has been changed.
Use the Bitmap Style Designer provided with the product.
You can find it in the Tools menù and, once started, you simply have to open the MetropolisUIBlack.vsf file, select the "style.png" item under Images and click the Export button (above the right panel where you can see a preview of the picture).
Edit the picture with your favorite editor (i.e. The Gimp), save the picture, and load it back in the style using the Update button (just left the Export one).
You can save your style with a different name and use it as usual.
HTH
When runtime themes are disabled for whole project, transparent images are drawn with black background. Is it possible to draw transparent image on button when runtime themes are disabled? The button I am using is from TMS Component Pack, its class name is TAdvToolButton. I need to have themes disabled because I want to fully control how application looks like. This is important request.
Please try to explain the connection between transparency & themes because I don't see it. I think these are two different things.
We would like to be able to customize the areas outside the form elements area itself, such that customers can have all their forms including the areas surrounding the form in their own style. For instance in the area on the top we would like to have a different color and we would like to replace the Orbeon logo by the logo of the customer. Also we would like to hide/remove/customize some buttons that appear below the form. For instance we don't need the buttons for PDF, Email and Close and we want to change the text in the Save button to Submit.
Is that possible? If so, how do we do that? Is there some instruction somewhere for this?
Yes, you can do all of this through properties:
You can change the color at the top by overriding the .fr-top rule defined in form-runner-orbeon.css. For more on how to override CSS, see: Default CSS.
You can replace or remove the default logo with the oxf.fr.default-logo.uri.*.* property. See Default logo.
You can choose which buttons are shown on the Form Runner "details" page by overriding the oxf.fr.detail.buttons.*.* property. See Buttons on the detail page.
You can change the label on a button by overriding resources. See Overriding resources.
I was faced with the problem to change the icon in the browser address and found the answer of Alessandro Vernet:
http://discuss.orbeon.com/page-address-bar-browser-icon-td4660752.html .
But this solution has the drawback that I had to change the orbeon-form-runner.jar, and this with every new orbeon forms release, what I wanted to avoid.
So the idea was to give my icons the same name as the orbeon icons and to load them in a corresponding directory of the resource directory.
So I named my icon orbeon-icon-16.ico and orbeon-icon-16.png and loaded the two files in orbeon/WEB-INF/resources/ops/images.
For Firefox this was OK, but IE continued to show the orbeon icon. Then I noticed that in orbeon-core.jar there where also the 32 pixel icon.
So I added the two files orbeon-icon-32.ico and orbeon-icon-32.png and than also IE was showing our icon.
I am new to jQuery. I want to use the "ui-icon ui-icon-triangle-1-e" with a color that matches my application ,also I dont want use a differnt .png file with the color I want. Please help me get this done.
Your best option is to use a different PNG file, that's the only option for this really (that works cross-browser). However it's pretty easy to get the color you want, use the jQuery UI ThemeRoller and you can configure/download the exact colors you want in a theme, including the icons.