cannot toggle 'off' for dynamic window size/position in rainmeter skin - skin

I have a skin that shows the top 10 processes using my pc's RAM. I want to stop the skin from automatically resizing.
When the skin is initialized, if the content exceeds the specified size parameters, the skin is resized/moved to fit this content.
I have implemented a refresh button that I can use to get the skin back to its intended position, but this is a stop gap measure and I'd like it to never change regardless of the length of the content.
the dynamicWindowSize parameter seems like it should be doing this but it is having no effect when set to 0.
Curiously, this never happens with my CPU skin, which has identical parameter settings.
here is my skin:
[Rainmeter]
Author=Pul53dr1v3r
AppVersion=1.1
Background=###Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14
DynamicWindowSize=1
[Variables]
fontName=Consolas
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,200
[MemTitleText]
Meter=STRING
MeterStyle=Style
StringAlign=CENTER
StringCase=UPPER
StringStyle=NONE
StringEffect=NONE
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=11
AntiAlias=1
ClipString=1
X=100
Y=12
W=45
H=18
Text="R A M"
[Refresh]
Meter=IMAGE
ImageName=###white.png
X=180
Y=12
W=16
H=15
LeftMouseDownAction=!RainmeterRefreshApp
[MeasureTopMem]
Measure=Plugin
Plugin=Plugins\TopProcesses.dll
ReQuery=1
IgnoredProcesses=Idle|_Total|rundll32|wscript|userinit
MetricType=Memory
ProcNums=1-10
Format="%Memory - %pName"
[TopMemText]
Meter=String
MeterStyle=Style
MeasureName=MeasureTopMem
StringAlign=LEFT
StringCase=UPPER
StringStyle=BOLD
StringEffect=NONE
FontEffectColor=0,0,0,50
FontColor=250,250,250,200
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1
X=35
Y=10R

Related

disable animation in BrowseFragment when selected item change

I want to disable the default animation on items in a BrowseFragment when they are selected ie scaling animation and the change of position. I want the items to stay where they are and not change their size when selected.
So far I tried various things on my ListRowPresenter object like setting the OnItemViewSelectedListene to null but without successful effect.
How can I achieve this ? (I'm using the version 26 of the leanback library)
You can set the zoom factor for the animation to none by passing in ZOOM_FACTOR_NONE to the constructor of the ListRowPresenter.
There is a constructor for ListRowPresenter to control the animation (focusZoom).
From the documentation:
ListRowPresenter (int focusZoomFactor)
Constructs a ListRowPresenter with the given parameters.
Parameters
focusZoomFactor int: Controls the zoom factor used when an item view is focused. One of ZOOM_FACTOR_NONE, ZOOM_FACTOR_SMALL, ZOOM_FACTOR_XSMALL, ZOOM_FACTOR_MEDIUM, ZOOM_FACTOR_LARGE Dimming on focus defaults to disabled.
Example:
ArrayObjectAdapter adapter =
new ArrayObjectAdapter(new ListRowPresenter(ZOOM_FACTOR_NONE));
setAdapter(adapter);
ArrayObjectAdapter rowAdapter =
new ArrayObjectAdapter(new MyCardViewPresenter(getContext()));
HeaderItem header = new HeaderItem("Header Title");
ListRow row = new ListRow(header, rowAdapter);
for (Video video : videos) {
rowAdapter.add(video);
}
adapter.add(row);

How to set min width on GtkScrollbar?

I want to develop new features in Quod Libet music player.
I need to increase size of specific scrollbar.
There's a function already exists to apply css to a widget:
def add_css(widget, css):
"""Add css for the widget, overriding the theme.
Can raise GLib.GError in case the css is invalid
"""
if not isinstance(css, bytes):
css = css.encode("utf-8")
provider = Gtk.CssProvider()
provider.load_from_data(css)
context = widget.get_style_context()
context.add_provider(provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
So I try to apply css as this:
self.scrollwin = sw = ScrolledWindow()
sw.set_shadow_type(Gtk.ShadowType.IN)
#get scrollbar
vscrollbar = sw.get_vscrollbar()
# 1rst attempt
# qltk.add_css(vscrollbar, '* slider {min-width: 20px;}')
#2nd attempt
qltk.add_css(vscrollbar, 'scrollbar.vertical slider {min-width: 20px;}')
I've got same error with 2 attempts:
'min-width' is not a valid property name (3)
Update 1
I try #Herbalist solution, scrollbar component is resized but "slider" always have same size. It add spaces on right and on left of "slider".
vscrollbar.set_size_request(50,-1)
Is it possible to resize slider of scrollbar ?
Screenshot of result (I outline part of scrollbar in green):
I'm not able to success with css, so I use deprecated method:
GtkRange:slider-width has been deprecated since version 3.20 and
should not be used in newly-written code.
Use the min-height/min-width CSS properties on the slider element. The
value of this style property is ignored.
As this:
qltk.add_css(vscrollbar, '* {-GtkRange-slider-width:40px}')
get_vscrollbar() returns a Gtk.Widget so you could try setting the "width-request" property

Is this ListView bug?

if create WC_LISTVIEW with LVS_REPORT style and set both LVSIL_SMALL and LVSIL_STATE (or with LVS_EX_CHECKBOXES) image lists and heigth of small images is less than heigth of state images - list incorrectly displayed: small images not centered by Y, but on same line with state images, and bottom lines (exactly CY_state - CY_small) is filled by trash. for example on high DPI display, ListView with LVS_EX_CHECKBOXES use 20 pixel heigth for CY_state, if use 15 pixel small icons - will be ~next picture (left side of image). if change state images heigh to <= CY_small will be normal displayed (right side of image)
this is known bug ? or exist ways resolve this ?
yes, this is ListView bug - present in all windows versions, including latest win10 builds.
bug in function
int CLVView::ComputeCYItemSize()
here exist next code:
int CLVView::ComputeCYItemSize() // this -> CLVReportView
{
// CListView* _pListView;
CLVImageListManager* p = _pListView->_pImageListManager;
...
if (p->_himlState)
{
p->_cySmall = max(p->_cyState, p->_cySmall);// bug !! need remove this line
...
}
...
}
if 'nop'
p->_cySmall = max(p->_cyState, p->_cySmall)
under debugger - all begin working ok and have next view:

How do I scale a container UIView's subviews' layout/size as I animate the container UIView?

Goal: to be able to animate a container-view's frame while it's subviews keep their original layout & scale in proportion to their container view.
Scenario:
Elements positioned via constraints/autolayout; within green container.
Green containerView's physical coordinates (frame/bounds) are adjusted per animation.
Members' compression & hugging properties are set to a low priority.
UIView.animateWithDuration(0, animations: {
self.bounds = myBounds
}) {(One) in
UIView.animateWithDuration(1, animations: {
self.frame = myFrame
}) {(Two) in
UIView.animateWithDuration(0.5, animations: {
self.frame = origFrame
// self.center = myCenter
}) {(Three) in
UIView.animateWithDuration(0.2, animations: {
self.frame = distantFrame
})
}
}
}
Here's the original layout:
I would like to have member element scale proportionally with their container view like this:
But the member elements (the one label 'Hello World!') don't adjust accordingly as their green containerView animates to a square in the upper left-hand corner:
How do I keep a UIView's members' layout in proportion to the prevailing their prevailing container view's frame?
Note: This would apply to any type of member (UIView, UITextView, ...etc.); for simple position/layout & transformation (pivot) animations.
In your example, you have a green background view (BG) and a hello world view (HW), and you want HW to scale in proportion to BG.
You can achieve this easily:
Open the Utilities pane in Xcode (top rightmost icon), and the Document outline (bottom left icon of storyboard).
Let’s assume that HW is already centered in BG, i.e. that you already set the alignment constraints for HW center horizontally and vertically in container.
Now, select BG as well as HW in the Document outline, and click the „Pin“ icon bottom right. It will offer the constraints „Equal widths“ and „Equal heights“. Activate both.
After these constraints have been created, open one of them in the Document outline. The utilities pane will then show the Equal Width constraint with the 2 views and a Multiplier field.
In the Multiplier field, you can enter the required proportions for the selected dimension, e.g. 1:3. This will fix the proportion for the selected dimension.
For the other dimension of course analogously. Of course you had then to update the frame of HW.
Here is an example:

Restricting the OptionGroup width in Vaadin

I have a couple of OptionGroups with very long captions that run across the width of the page, which looks very bad. I tried restricting the width of the OptionGroup using setWidth and via CSS, and also tried restricting the width of the parent container; all without effect.
So I made a grid layout with an option group in the first column (spanning all rows), and individual labels for the captions in the second column (one per row). However, in case the captions span multiple lines (which they do in my case), this leads to the radio buttons / checkboxes no longer being aligned to the captions. (Regrettably, I'm not allowed to post images.) For instance,
(o) This is a multiline
(o) caption
This is another multiline
caption
I resolved this by creating one OptionGroup per label, and adding each option group in the first column:
(o) This is a multiline
caption
(o) This is another multiline
caption
Clearly, in case of radio buttons, this means multiple buttons can be selected at the same time, since they are no longer linked via a single OptionGroup. Therefore, I registered listeners which, each time a button is selected, de-select all other buttons. And this brings me to my problem; since this "unchecking" is done at the server side, there will unavoidably be some lag, meaning that for some time, multiple radio buttons will appear selected at the client side.
Any ideas on how to resolve this? I only started working with Vaadin recently, so I'm far from an expert. Is there some simple way of restricting the caption width (some magical undocumented CSS class), or do I need to extend / adapt the client-side widget implementation?
Thanks,
William
What you need is FlexibleOptionGroup add-on.
Here is an example implementation:
#Override
protected void init(VaadinRequest request) {
Container cont = new IndexedContainer();
cont.addContainerProperty("caption", String.class, "");
// very long strings in the following setValue() methods
cont.getContainerProperty(cont.addItem(), "caption").setValue("I have...");
cont.getContainerProperty(cont.addItem(), "caption").setValue("So I ma...");
FlexibleOptionGroup fog = new FlexibleOptionGroup(cont);
fog.setCaption("FlexibleOptionGroup:");
fog.setItemCaptionPropertyId("caption");
fog.setMultiSelect(true); // force using CheckBoxes
VerticalLayout fogLayout = new VerticalLayout();
Iterator<FlexibleOptionGroupItemComponent> iter;
iter = fog.getItemComponentIterator();
while(iter.hasNext()) {
// OptionGroupItem part (CheckBox or RadioButton)
FlexibleOptionGroupItemComponent fogItemComponent = iter.next();
// CustomComponent part
Label caption = new Label(fogItemComponent.getCaption());
caption.setWidth(400, Unit.PIXELS);
fogLayout.addComponent(new HorizontalLayout(fogItemComponent, caption));
}
setContent(fogLayout);
}
The above code produces:

Resources