I am using bootstrap switch and I installed it with Nuget package manager. This is what my solution explorer looks like after the installation:
Then I add two new bundles for them in my BundleConfig.cs:
I used the bundle in my layout view like this:
In the actual view, I have a checkbox like this:
I also initialize the bootstrap switch in the document ready function:
but when I run the page, it still looks like I didn't include the css file correctly:
Related
I can't find how to load my own icons in Flet.
I'm testing Flet with the intention of making a desktop app (pure desktop, not Internet needed), but I'm not able to use my own icons to begin with. I can only use the ones that come inside ft.icons, but I'd rather use my own by loading them from a folder similar to /assets/icons. Can I do that? How?
Thanks.
Currently, I don't see a way of doing this; however, you could use the Image class instead.
I would suggest you create an assets folder under your main project folder.
Let's assume you have the following folder structure on your project:
/assets
/icons/my-icon.png
main.py
When you are running your app, you should provide that folder to the initializer in the following way:
flet.app(target=YourApp(), assets_dir="assets")
Then you can access your images there directly and create an Image instance in the following way:
test_image = flet.Image(src="icons/my-icon.png", width=32, height=32, tooltip="Image Tooltip")
You can nest these Image controls inside of anything you want, so you have a lot of flexibility.
The only downside of doing it this way is if you are using light/dark themes on your app. Compared to the Icon class, you will have to specify the light/dark theme versions yourself and update them manually when you are switching your theme.
Here is the official documentation
I am building a cn1 app and was so far using the "Theme" in the GUI Builder to change the look of containers and buttons. I now want to add a specific border to a container and I find it easier to accomplish the border through css, I found the instructions on how to do it and the code here: https://www.codenameone.com/blog/rounded-corners-shadows-and-gradients-with-css.html . I added the .jar, made a css folder and add my theme.css file with the code. In my form's beforeshow method I change the uiid of a container to the uiid defined in my theme.css. However when I run the app the container takes on the default Container uiid, not the one defined in my .css. I feel like this is because I already have a theme defined in my gui builder with my uiids and now I am trying to change a container's uiid to a uiid defined in another theme. Is there something I'm doing wrong here?
If I understand correctly you have two themes and you want to use elements from both in the app. There are two valid scenarios, one where both of the themes are in the same res file and another where both of the themes are in a separate file.
If they are in the same res file do this:
theme = UIManager.initNamedTheme("/theme", "firstTheme");
UIManager.getInstance().addThemeProps(theme.getTheme("secondTheme"));
If they are in a separate files do this:
theme = UIManager.initNamedTheme("/theme", "firstTheme");
Resources otherTheme = Resources.openLayered(("/otherTheme");
UIManager.getInstance().addThemeProps(otherTheme.getTheme("secondTheme"));
This is discussed in the Codename One Developer Guide under Theme Layering.
I made some changes to rocket.chat, adding a few pages and css styles , and I have a question: how can I generate a package like rocket.chat.cordova.
Due to the css styles built in server, when I run 'meteor run ios', it can't load styles and shows me the blank screen.
I am using PHPStorm to develop a Symfony2 application. Everything works fine, but the 'Framework' tab doesn't show my controllers, resources and bundle contents.
It should be like this:
http://www.kevwebdev.com/img/2012/11/phpstorm-framework-tab.png
I have this:
http://pl.tinypic.com/view.php?pic=2dsls08&s=8#.U7LuDPl_sqE
I have controllers in my project, but PHPStorm doesn't show them.
Any idea what's wrong?
You need to fix your project settings. Go to File->Settings->PHP->Framework Integration and make the necessary changes as shown in the screenshot below. To change a setting for a given directory, just click in the 'Element' column and you'll get a drop down selector with the available options.
Afterwards, everything should be working fine.
Hi am new to Samsung Smart TV App,
I want to create some rich user interface with CSS and Javascript. I think Twitter Bootstrap is a good choice for this. But i cannot use bootstrap's class properties in my application. Guide me how to use twitter bootstrap framework in Samsung Smart TV App.
I have successfully used bootstrap in one of the apps I created. Just add the bootstrap code to the project's directory and reference it from the index.html like you would with any style sheet.
Also make sure that you include the following at the top of all of the individual scene style sheets
#import url("<PATH TO BOOTSTRAP>/bootstrap.css");
I think you should use sf.core.loadCSS(); in your application. Just see guide. There is analogous method for JS including too.
If you're using AppsFramework 2.0 app structure (Basic App Project) you should place it in your app/init.js like this:
function onStart() {
sf.core.loadCSS([
"app/stylesheets/file1.css",
"app/stylesheets/file2.css"
], function () {
// callback on file loading
});
}
Callback function isn't mentioned in documentation, but it works (I'm sure for JS, CSS should work same way).
But if you're using "Javascript App Project" template (the old one), then you can place mentioned <style>#import url();</style> in your root index.html.