I recently used shinyBS to create a modal window, as in
bsModal(id, title, trigger, ..., size)
The size argument is either 'small' or 'large' (or absent).
As you can see, even the large window is pretty small and things get packed in pretty tightly:
Is there any possible hack anyone out there has found that can help to customize the size of the window?
I know this topice is old but since I found a solution I post it for the person going here to find an answer.
You can do it by changing the CSS style. At the begging of your app just precise :
.modal-lg {
width: 4000px;
}
or
.modal-lg {
width: 95%;
}
To change the size of the size = "large"argument in the modal or
.modal-sm {
width: 40px;
}
to change for the small one. Of course change the px to change the size as you want to.
In your application, put the code here to have it available for your app:
dashboardBody(
tags$head(tags$style(HTML('
.modal-lg {
width: 4000px;
}
'))),
#ALL YOUR APP GOES HERE
)
Related
I try to use a smaller horizontal Gtk::ProgressBar in my project.
The standard minimum width as defined in /usr/share/themes/Adwaita-maia/gtk-4.0/gtk.css is 150px :
progressbar.horizontal > trough {
min-width: 150px;
}
When I change the 150px to 50px in this file I can squeeze the Gtk::ProgressBar smaller than 150px in the application.
So I tried to override this. In the header file, there are the class members
Gtk::ProgressBar **progressBar_channel_buffers;
Glib::RefPtr<Gtk::CssProvider> m_refCssProvider;
In the constructor, I tried
m_refCssProvider = Gtk::CssProvider::create();
m_refCssProvider->load_from_data("progressbar.horizontal {"
"min-width: 50px;"
"}");
progressBar_channel_buffers = new Gtk::ProgressBar*[num_channels];
for (int i = 0; i < num_channels; i++){
progressBar_channel_buffers[i] = new Gtk::ProgressBar;
progressBar_channel_buffers[i]->get_style_context()->add_provider(m_refCssProvider, 1000);
}
This has no effect and I wonder why. When I change for example another CSS property I can see an effect. As an example
m_refCssProvider->load_from_data("progressbar.horizontal > trough, progressbar.horizontal > trough > progress {"
"min-height: 50px;"
"}");
shows the expected effect.
Can you please help me? What am I doing wrong? I started programming Gtk(mm) this week and now I am at a point where I have no idea.
If I am reading your code correctly above, I think the only thing you did incorrectly was mistype the style attribute you were wanting to modify (height instead of width). In your code snippet, it states:
m_refCssProvider->load_from_data("progressbar.horizontal {"
"min-height: 50px;"
"}");
Whereas, I think you meant to type:
m_refCssProvider->load_from_data("progressbar.horizontal {"
"min-width: 50px;"
"}");
Also, having poked around in the source code for GTK4, I did see that the progressbar widget is actually comprised of a child "trough" widget and a child "progress" widget. That leads me to deduce that the ultimate minimum width of the progress bar that is displayed would be limited to the largest value for minimum width for either the progress bar widget or its children widgets. Therefore, you would need to utilize the "load_from_data" statement where you not only apply the minimum width value to the progress bar node, but also to the trough node and the progress node.
I hope that makes sense.
Regards.
I want to figure out how to grab the title in a plugin in ChartJS I have the title in the configuration like so:
title: {
display: true,
fontSize: 10,
text: "This is my title",
padding: titlePadding,
}
I was just curious if I want to do some afterDraw work, how do I grab it and alter it? I want to do some manipulation later in the event sequence.
You can get the title text by calling chart.titleBlock.options.text, although even if you update it and call chart.update() it will render the updated title in the first draw tick but the other draw ticks it will use the normal defined title again, see fiddle: https://jsfiddle.net/Leelenaleee/kc8qua61/12/
You are better off using a scriptable option for the title as shown in de documentation sample of chart.js here: https://www.chartjs.org/docs/master/samples/line/stepped.html.
It takes a part of the config to show in the title as a dynamic part and internally chart.js handles it, you can also use external variables here.
Hello R Studio Community,
I've been developing an app in Shiny and it's be great. I have one simple question.
As different browsers have different widths, is there a way to set the rule on resizing the Shiny dashboard based on the following:
1) If browser width is more than x, limit to width to x and center the entire dashboard
2) If browser width is less than x, follow default autosizing
3) Not essential. But how do I set the blank space color to the left and right of the dashboard
The motivation is that I need a fixed width so that some pictures are scaled correctly. I hope my request can be done through some div tag on the dashboardPage.
This is the current behavior which I do NOT want.
Shiny dashboard stretches to fit window
Cheers,
Donny
Hi to achive what you are asking for just add the following code to the beginning of your dashboardBody. something like this
dashboardBody(
tags$head(
tags$style(
"body{
min-height: 611px;
height: auto;
max-width: 800px;
margin: auto;
}"
)
),
... #the rest of you ui code
hope this helps
I'm working on a software which contains combobox with a lot of items inside, the problem is when I click on it the list is too large and I can't see all of the items by scrolling on it.
The style cleanlooks is used (that's why the combobox have a too large size) but I can't change it so I'm looking for a solution to set a maximum size.
I found nothing about this on the web, neither in the documentation.
I tried to use the size policy but doesn't work. I also tried to get the QLineEdit used by the combobox and to set a QSize on it and finally to by setting stylesheet on the combobox and on the QLineEdit but nothing worked properly.
What I tried with the QSize and the stylesheet :
sz = QSize(20, 20)
combo.view().setGridSize(sz)
combo.view().setStyleSheet("""QListView { max-height: 50px; background-color: yellow; } """)
combo.setStyleSheet("""QComboBox { max-height: 30px; background-color: pink; } """)
EDIT: After the comment of #Vladimir Bershov I tried to set correctly the size with : setMaxVisibleItems() but as said in the doc ("Note: This property is ignored for non-editable comboboxes in styles that returns true for QStyle::SH_ComboBox_Popup") the property is ignored.
So I looked for modify the QStyle Hint to unset the SH_ComboBox_Popup but as explained on this post that's impossible.
If you have any suggestions I'm listening.
Thanks.
Like explained in the comments there's no available solutions in PyQt4
This line worked for me when I was trying to minimize the height of the QComboBox dropdown in Qt/C++.
ComboBox->setStyleSheet("combobox-popup: 0;");
I am new to foswiki, and have it spun up running on a vm at my companies datacenter.
I have most of the baseline config down, but am wondering about some more customization.
Specifically I am looking for some documentation on how to customize the sidebar. Any documentation or tips ya'll hit me back with would be appreciated!
Thanks!
I assume you are using the default theme 'PatternSkin'
One Example of modifying the Sidebar is to change the width:
to do this create a attachment 'SidebarCustomWidth.css' with the following css
#patternOuter {
margin-left: 8em;
}
#patternSideBar {
width: 8em;
margin-left: -8em;
/*background-color: rgb(200, 200, 255);*/
}
/* remove padding */
#patternSideBarContents {
padding-right: 0;
padding-left: 0;
}
then you can use it with
* Set USERSTYLEURL = %PUBURLPATH{topic="TheWebname.TopicWithAttachment" "SidebarCustomWidth.css"}%
you can find this example at
https://foswiki.org/Sandbox/StefanKr%C3%BCger/PatternSkinCssCookbookSidebarCustomWidth
and some more Documentation and Examples at
https://foswiki.org/System/PatternSkinCssCookbook
Other Options to customize the Content of the Sidebar can be found at
https://foswiki.org/System/PatternSkin#Top_44_Bottom_and_Left_Bar_customization
regarding the Sidebar you can look for WebLeftBar.
every web has its own Topic WebLeftBar. you can change this to your needs. If a Web has no WebLeftBar Topic and no WebLeftBarExample Topic (thats the fallback) the Sidebar does not render.
if you want to change the defaults for new webs you can do this in the _default web.