How to change Widget style in SWT, of existing widget - swt

How to change Widget style in SWT, of existing widget, Means i am working on ProgressBar and i want to change it's style SWT.VERTICAL from SWT.HORIZONTAL

You can't, styles are fixed once the control has been created.
In some cases SWT may use a completely different native control to implement the SWT control depending on the style flags. For example on macOS a Combo with the SWT.READ_ONLY style uses a different macOS control to a read/write Combo. This would make allowing you to change the style very complex.

Related

how to customise the toolbar for a flutter SelectableRegion

When text in a SelectableRegion widget is selected, the toolbar generated by materialTextSelectionControls has options for 'Copy' and 'SelectAll'. What is the best way to disable 'SelectAll' and how can the styling (in particular, text color) of the options be changed?
So far, my answer to my question is to copy the relevant flutter files for the SelectableRegion widget and customise them to make a MySelectableRegion widget.
But surely there is a better way?
For anyone wanting to do the same as me, the files I copied and am editing are
flutter/packages/flutter/lib/src/widgets/selectable_region.dart
flutter/packages/flutter/lib/src/material/text_selection.dart
flutter/packages/flutter/lib/src/material/text_selection_toolbar.dart

Flutter: Using expansion panel with navigator animate the AppBar when expansion panel is open

In one section of a client's app an expansion panel / accordion is used to open some content. At the same time the AppBar is supposed to animated as is a new route has been pushed but the new route's content should display in the body of the expansion panel.
I have been able to implement this by creating an entirely independent Widget and using a state management library but it is not a tidy solution.
I wondered if it is possible to use the App's main Navigator but not remove the current route's body. This cannot be done with a nested navigator either as the AppBar uses Hero tags that are not reflected between Navigator's.
Is there a simple way to achieve this without using entirely customised state management.
Flutter's in built Navigator, even Navigator 2.0, is well known to not be a particularly friendly interface to use, so I'd recommend the use of a community library that makes things easier.
Auto Route is a popular solution that I use personally and can attest to its quality. For your particular problem it offers navigation observers which you can register. You could use this to trigger the animation of your app bar when the new route is pushed.
It will be a little bit of effort to replace your current navigation with a new library but I'd imagine you'll end up with a cleaner solution at the end instead of customized state management.

Flutter: Make text/images selectable in whole web app

In the Flutter web apps, there is no default functionality which makes text and images in the app selectable.
Is there a way to enable selection functionality for text/image on web?
I did check SelectableText widget but it is only for text and I would need to use it over every text. Also, you can't select text in multiple SelectableText widgets at once, you can only select text in one of them. I'm looking for a solution to select all text in the app without making change to every text widget.
Let me know if there’s one step solution to achieve this thing in whole web app.
In Flutter 3.3, with the introduction of the SelectableArea widget, any child of the SelectableArea widget has selection enabled for free!
To take advantage of this powerful new feature, simply wrap your route body (such as the Scaffold) with the SelectionArea widget and let Flutter do the rest.
For a more comprehensive deep dive into this awesome new feature, please visit the SelectableArea API page.
Flutter Web currently does not support multiple text selection across SelectableText widgets.
However, there are some experimental widgets that people are currently working on. According to a guide available at:
Custom SelectableScope Widget
They have proposed a custom widget, a Selectable scope, which basically allows for anything within it to be selectable (currently text and images)
NOTE: THIS IS CURRENTLY UNDER EXPERIMENTATION AND MIGHT CHANGE AS MENTIONED IN THE PROVIDED LINK.

Programmatic Control of Edit Widget Font Size?

SwiftUI offers .dynamicTypeSize(...) to control/limit the impact of user Text size preferences. An app developer, for example, can limit dynamic type to DynamicTypeSize.xxxLarge rather than allow a larger accessibility size that might complicate UI design.
https://developer.apple.com/documentation/swiftui/dynamictypesize
Can a developer also limit dynamic type size of a widget's configuration UI ... the UI that appears after users long-press on a widget then select Edit Widget?

How to make widget to occupy all the available space in Gtk.HBox

I am implementing a custom Gtk# widget which is based on Gtk.EventBox. When I am inserting it into the HBox or VBox it occupies the exact size that is returned by OnSizeRequested method.
How can I make my widget to occupy all the space given to it by the parent box, window or the widget? Just like HBox does.
There is a slight different between the preferred way to do packing in GTK+2 vs GTK+3. With GTK+ you would typically use expand and fill properties of a GtkBox to control how space is allocated. With GTK+3 they are suggesting the user of vertical-expand, horizontal-expand, vertical-fill, horizontal-fill.
A good way to understand how packing works is to play with the fill and expand properties with Glade so you can see the effects in real time. An old tutorial (slightly out of date) shows some screenshots of different packing properties: How_Packing_Effects_the_Layout
As you are developing a widget it is more likely that users of your widget will determine how it should be packed in a larger UI. However, if you're widget is a composite widget (built from other widgets) then you will need to pack the other widgets properly.
PackStart and PackEnd have a fill parameter to specify items that should expand to fill the box. You probably want PackStart(widget, true, true, 0);