Skip to content

Dialogs: Enhance look and feel #5334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Alpha-Centauri-00 opened this issue Feb 7, 2025 · 8 comments
Closed

Dialogs: Enhance look and feel #5334

Alpha-Centauri-00 opened this issue Feb 7, 2025 · 8 comments

Comments

@Alpha-Centauri-00
Copy link

The Dialogs library in Robot Framework, which is based on Tkinter, plays a key role in creating interactive tests. However, the styling and design options are currently quite limited.

@pekkaklarck pekkaklarck added this to the v7.3 milestone Feb 7, 2025
Alpha-Centauri-00 pushed a commit to Alpha-Centauri-00/robotframework that referenced this issue Feb 7, 2025
@pekkaklarck pekkaklarck changed the title Enhance Styling and Design for Dialogs Library Dialogs: Enhance look and feel Feb 11, 2025
@LucianCrainic
Copy link
Contributor

Hello @pekkaklarck, what do you think about the idea of switching from Tkinter to Flet (https://flet.dev/) which provides a better styling and design options ?

@pekkaklarck
Copy link
Member

I don't think it's a good idea with the version distributed with Robot. It would be fine if you'd create an external library for this purpose.

@LucianCrainic
Copy link
Contributor

Thanks for your feedback! Could you clarify what you mean by creating an external library for this purpose? Are you suggesting a standalone package that integrates with Robot Framework, or something else? I'd appreciate any guidance on the best approach since i would love to start contributing to the project after the wonderful experience at the Robocon 2025.

@pekkaklarck
Copy link
Member

PR #5333 implements this.

@pekkaklarck
Copy link
Member

@LucianCrainic Yes, I meant creating an external library. It could have same keywords as the standard Dialogs to make switching to it easy, but it could also get new keywords if there are needs. New keywords could then possibly be ported to Dialogs if they are generally useful and its technically feasible.

@pekkaklarck
Copy link
Member

pekkaklarck commented Mar 24, 2025

I reviewed PR #5333 and it turned out to have various technical problems. The problems are due to the PR trying to workaround Tkinter styling limitations (e.g. styling the title native title bar isn't possible) and they seem to be way bigger than the benefits. My current thinking is that we should limit style changes to these:

  • Background color. We could easily set background to one of Robot's "official" colors (black, white, turquoise), but it is somewhat questionable is that useful. I started a thread and a poll about this on the #devel channel on our Slack and most of the first poll respondents prefer the native style (i.e. making no changes).
  • Padding. Dialogs can be made better looking by adding padding around elements.
  • Increase font size a bit. The current font size is pretty small.
  • Application and taskbar icon. We could use our normal logo here.

My plan to go forward with this is:

  • Commit padding and font-size changes. I'll probably make the background color easy to change at the same time, but leave it to the native style for now.
  • Add icons.
  • Wait for options about the background color and possible other style enhancements on #devel. Comments are appreciated here as well.
  • Close PR Styling dialogs #5333. Sorry for that @Alpha-Centauri-00, but the complexity and the problems caused by it aren't worth the benefits.Thanks anyway for starting the discussion about style enhancements and looking forward for your opinions.

pekkaklarck added a commit that referenced this issue Mar 25, 2025
Increase the minimun dialog size a bit to match the increased font
size.

Make padding and font configurable using class attributes. Also make
background configurable, but leave it to the default value for now.

Part of #5334.
pekkaklarck added a commit that referenced this issue Mar 25, 2025
The logo is needed by Dialogs (#5334), but it can be used also by
external tools. Fixes #5385.
pekkaklarck added a commit that referenced this issue Mar 25, 2025
It depends on OS how/where icons are shown. For example, on Linux with
Gnone there's no icon in the dialog, but there's a taskbar icon as
well as an icon in the application switcher. On Windows there's a
taskbar icon and also the dialog itself has an icon. OSX is yet to be
tested.

This is part of #5334.
pekkaklarck added a commit that referenced this issue Mar 26, 2025
When `Get Selection From User` is used with a default value, not only
select that value but also activate it. That affects moving the
selection with arrow keys. Now the initial position is the selection,
earlier it was the first item.

To some extend related to Dialog look and feel enhancements
(#5334). Too small fix to deserve its own issue.
@pekkaklarck
Copy link
Member

I've done all enhancements I planned to do. The image below shows new and old dialogs on Windows, and I consider the new one better in many ways. I've also tested this on Linux and OSX and everything seems to work fine.

Image

@d-biehl has made even more changes in PR #5381. We need to still decide do we want to incorporate them, or part of them, before closing this issue. We can also close this and do more style enhancements in RF 7.4.

@pekkaklarck
Copy link
Member

Let's close this and consider more enhancements later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants