How to suppress tqdm flashing bar after description - tqdm

I need to update the description in a loop. I've simplified my case to just print text; there's no progress bar. Code is like this:
fake = faker.Faker()
pbar = tqdm(bar_format=" {desc}")
for _ in range(1000):
time.sleep(0.1)
pbar.set_description_str(fake.name())
pbar.close()
Problem: there's always a narrow, flashing bar at the end of the description, very much like the wide cursor.
Question: how can I get rid of this flashing bar, and just cleanly print text only?
Earlier I wanted to show this text line below a progress bar. This flashing bar goes above its own line and causes worse interference. I'm not attempting that now. Hope to solve the simpler problem above. Thanks.

Related

Jetpack Compose - Change default Visible % in ModalBottomSheetLayout

I have a ModalBottomSheetLayout with a list of items in my Compose view, which can be showed by some UI interaction.
By default, when bottomSheetState.show() is called, the visible ratio for the BottomSheet is 50%. However, this is not ideal from a UX perspective as the user will have to physically pull up the bottom sheet to see all the contents in the list.
Extremely frustrating is the fact that bottomSheetState.show() does not take in any parameters, and that the 50% value seems to be hard coded in. According to the declaration in androix.compose.material:
suspend fun show() {
val targetValue =
if (isHalfExpandedEnabled) HalfExpanded
else Expanded
animateTo(targetValue = targetValue)
}
I would like to instead show a custom value, say 75%, when the bottom sheet is showed, but so far I haven't found a way to do so. Is there a workaround to this?
I am not sure if you can make it 75% visible but you can show it expanded
bottomSheetState.animateTo(ModalBottomSheetValue.Expanded)

Jetpack Compose BottomSheetScaffold: Smooth closing

I'm using Jetpack Compose with the BottomSheetScaffold. To be able to show and hide the bottom sheet from both within and outside the composable, I used a showBottomSheet: MutableState<Boolean> variable. The peek height within the composable is then determined like this:
val baseBottomSheetPeekHeight by remember { mutableStateOf(60.dp) }
val bottomSheetPeekHeight = if (showBottomSheet.value) baseBottomSheetPeekHeight else 0.dp
Later, in the BottomSheetScaffold, I use the variable like this:
BottomSheetScaffold(
...
sheetPeekHeight = bottomSheetPeekHeight,
...
)
(Full reproducer project here: https://github.com/dbrgn/compose-repro)
This generally works as intended, I can set showBottomSheet.value to false to hide the bottom sheet. However, the hiding looks janky, because not all sub-composables are hidden at the same time.
It's a bit hard to see in the animation above due to the GIF conversion, but when closing the bottom sheet peek pane, the other content (below it) is visible for a short moment, before the bottom sheet disappears.
Is there a way to avoid this janky hiding behavior? Or even better, is there a way to smoothly animate the hiding of the pane?
In my case for Smooth closing BottomSheetScaffold I used to: scaffoldState.bottomSheetState.animateTo(Collapsed, tween(duration))
-- (when duration is any Int you want).
The same for Expanding:
scaffoldState.bottomSheetState.animateTo(Expanded, tween(duration))
If you look at the source code of collapse() or expand() function, you will see there just calling animateTo(Expanded) and animateTo(Collapsed). You can customize animateTo() as you wish.
See animateTo() documentation.

How to remove the iPad's bottom copy/paste bar when editing a UITextView?

I have an app that allows the user to edit a UITextView, however the copy/paste/cut bar pops on the iPad, blocking some of the bottom of the interface, as the following screenshot shows:
I would prefer getting rid of it instead of adjusting the interface, is there any way to accomplish this?
NOTE: This only appears on the iPad!
EDIT: My UITextView is entirely editable, therefore, this is not a duplicate of How disable Copy, Cut, Select, Select All in UITextView ! Also, I don't want to just disable the buttons, I want the whole bottom bar to go away!
EDIT 2: Updated the image for more clarity, as some answers are addressing the small black one that appears near the cursor.
You can hide this as below,
yourTextView.inputAssistantItem.leadingBarButtonGroups = []
yourTextView.inputAssistantItem.trailingBarButtonGroups = []

Hammerspoon: drawing a line in the title bar of a window

I am trying to draw a red line in the title bar of a focused window. For this, I created code similar to the following (it is meant to be a minimal example):
function foo()
f = hs.window.focusedWindow():frame()
line = hs.drawing.line(hs.geometry.point(f.x, f.y),hs.geometry.point(f.w,f.y))
line:setStrokeWidth(10)
line:setStrokeColor(hs.drawing.color.red)
line:show()
end
If I enter this into the Hammerspoon Console, followed by
foo()
it draws a line outside the window, not on the title bar, if the Console is placed in the right half of the display. Please see the attached screenshot. In fact, the position and length of the red line change, depending on the location of the Console window, and the desired red line can be drawn on the title bar, if the Console is in the left half of the display. I totally got confused. What is wrong with the code?
Can anyone help?
EDIT
More photos are added. Note that setStrokeWith(30) is used.
As is, the code will place the bar windows width away from the left side of the screen. The seemingly fixed position is because the window width is the same. Use:
hs.geometry.point(f.x + f.w, f.y)
To place the second point as on offset from the first.

jqueryui progress bar options like transparency and text

Can I have text in the background of a jQuery UI progress bar?
You know the kind I'm talking about don't you?
The kind that where color:white because the progress bar is over it, and color:black because the progress bar hasn't reached it yet.
I think I've seen that type of effect while installing software.
Also, what about a background-image, which works, except that it is totally covered up by the progress bar? I'd like for the progress bar itself to be a little bit transparent.
No. That's impossible.

Resources