Code Monkey home page Code Monkey logo

Comments (19)

mobab-th avatar mobab-th commented on May 29, 2024 1

Today i could download the file.
Zoom in/out worked now for me.

THX

from iped.

lfcnassif avatar lfcnassif commented on May 29, 2024 1

e.g. panels with absolute layout

Sorry about that.

2. So instead of setting a proportion (like 125%), the font size (an integer) is set.

I'm fine with this.

  1. the user would need to restart the application after this configuration is changed.

I'm fine with this too, since it would be uncommon as you pointed out, and I think this issue shouldn't spend too many efforts.

from iped.

lfcnassif avatar lfcnassif commented on May 29, 2024 1

so far as i know can java greater version 8 solve the DPI-problem

@tc-wleite just to don't forget, do you know anything about this?

from iped.

wladimirleite avatar wladimirleite commented on May 29, 2024 1

Worked a bit more on this, and I would like to update the pros and cons I posted before.

I realized another important disadvantage of the dpi-aware approach:

  • Visual controls that are "inside" libraries used by IPED may be hard to be scaled. Some of them do not provide a method to access such things. It is possible to use reflection to overcome that in most of the cases I have seen so far, but it would create unnecessary complexity and undesired coupling between IPED code and the used libraries.

One the pros I mentioned before was the possibility of adjusting fonts to user preferences.
But that can be achieve with using the system property sun.java2d.uiScale.
For example, as I mentioned, the automatic rescaling made the fonts larger than I would like in my screen. Using -Dsun.java2d.uiScale=1.8 (in the command line) scaled IPED's UI exactly how I wanted.

After weighting pros and cons, I propose:

  1. Close this issue and let newer Java versions take care of resolution awareness.
  2. Also close #679, removing that feature from the code, as it is hidden, doesn't work very well and may conflict with bookmark shortcuts. Using "uiScale" is a better solution.
  3. The explicit "uiScale" parameter requires using the command line. Well, there are other tricky ways, but they all seem inconvenient for longer term usage (I would like to keep the same scale setting in my PC, whenever I use IPED). So I suggest adding the support for a simple configuration file, in user home directory. The application would only read it (if present), and set the values read from there.
  4. While working on this feature, I implemented a few minor improvements in GUI related code. I would like to create another issue (something like "Minor GUI improvements") and "move" the changes that I would like to keep to there.
  5. Automatic scaling based on screen resolution and fine tuning using "uiScale" depend on newer Java versions. For a quick test (with Java 9, 11 and 14) I just had to setup JavaFX manually, but I know that there are open issues related to newer versions support (#205, #478). I noticed that Java 11 is the adopted version in many places, so I think that making IPED compatible to these newer versions is important.

from iped.

lfcnassif avatar lfcnassif commented on May 29, 2024 1

Thank you very much @tc-wleite for all your work on this! I completely agree with your last proposals, all of them. Updating to java 11 seems a good idea since it's LTS (I think java 17 will be much harder since they removed some components, deprecated APIs and Unsafe access). Some weeks ago I took a quick look at #205, uncommented some printstacktrace() in LibreOfficeViewer code but no error was printed in log, it's a bit weird. I'll take a look at #478.

from iped.

lfcnassif avatar lfcnassif commented on May 29, 2024

Hi Wladimir, I didn't remember. But in a specific situation I used "CTRL+" / "CTRL-" in a user computer and he became very surprised by the hidden feature :). It is not perfect, but could be exposed in the options menu.

DPI aware would be nice...

Seems #45 is going on. Thank you!

from iped.

wladimirleite avatar wladimirleite commented on May 29, 2024

Well, I guess 4K or higher resolution monitors are still not as common as I thought among IPED users...
Probably in the near future this effort would make more sense.

from iped.

mobab-th avatar mobab-th commented on May 29, 2024

"CTRL+" doesn't work, "CTRL-" work
so far as i know can java greater version 8 solve the DPI-problem, but iped-search-app.jar doesn't work for me with java 9 or higher.
A way to increase the font-size would be nice ...

from iped.

lfcnassif avatar lfcnassif commented on May 29, 2024

"CTRL+" doesn't work, "CTRL-" work

This worked here on Windows, although it was slow, but not for all UI texts, I will open another issue to track fixing it.

but iped-search-app.jar doesn't work for me with java 9 or higher

Currently this project just support java version 8, although it may work with later versions, but we don't support them for now.

from iped.

lfcnassif avatar lfcnassif commented on May 29, 2024

"CTRL+" doesn't work, "CTRL-" work

what is your keyboard layout?

from iped.

mobab-th avatar mobab-th commented on May 29, 2024

what is your keyboard layout?

System Locale: LANG=de_DE.UTF-8
VC Keymap: n/a
X11 Layout: de
X11 Model: pc105

from iped.

lfcnassif avatar lfcnassif commented on May 29, 2024

Thanks, @mobab-th. Could you test the snapshot below with a possible fix to Ctrl+ using your keyboard? It should be ready in 5min.
https://github.com/sepinf-inc/IPED/actions/runs/1098657533

from iped.

mobab-th avatar mobab-th commented on May 29, 2024

from iped.

wladimirleite avatar wladimirleite commented on May 29, 2024

@lfcnassif, I started to work on this a few days ago and managed to validate the idea mentioned in #679 (comment).

The basic concept is that it will change LAF (Look and Feel) font size and scale all other controls accordingly, during the application startup.
There are still many details to be adjusted (e.g. panels with absolute layout, icons), but so far the result seems "very good".

The main use cases for this feature that I can imagine are:

  • High resolution screens (currently, a possible workaround for too small fonts is to use upscaling, but this "wastes" the quality of a high resolution screen).
  • Users that want to make a minor adjustment (slightly smaller/larger fonts).

Two points that I would like to validate with you:

  1. "Static" Configuration
    One limitation of the solution I am implementing is that is not "dynamic", i.e. the user would need to restart the application after this configuration is changed.
    While this is obviously inconvenient, implementing something dynamic would require too many code changes, and I am not sure everything would be covered.
    I believe that users would not be changing this setting too often in practice.
    On the other hand, I am aiming to make the scaled interface as "nice" as possible, as the non-scaled one is, so nothing looks "out of place" when the application is scaled (# 679).
    The dynamic "CTRL +/-" approach makes sense for an application like a browser, in which the content change a lot, and for different websites different zoom levels are required, but I don't see as crucial for an application like IPED.

  2. Font size based
    The current font size used in IPED interface is 12.
    For now, I created a configuration file in ".indexador" (inside the user folder) with the desired font size.
    So instead of setting a proportion (like 125%), the font size (an integer) is set.
    For everything else, the code calculates the proportion.
    I think this way is better because in many places an integer is used, and sometimes different proportions would mean the same font size (e.g. a scale of 115% and 120%, would both increase the font from 12 to 14).

from iped.

wladimirleite avatar wladimirleite commented on May 29, 2024

e.g. panels with absolute layout

Sorry about that.

Not a problem! I also used that in some places...

I'm fine with this too, since it would be uncommon as you pointed out, and I think this issue shouldn't spend too many efforts.

Thanks for the reply!
To summarize my previous (too long) explanation, the feature will be "static" but the visual result should be better (and hopefully more useful) than what we have today.

from iped.

wladimirleite avatar wladimirleite commented on May 29, 2024

so far as i know can java greater version 8 solve the DPI-problem

@tc-wleite just to don't forget, do you know anything about this?

Yes, JEP 263 introduced in Java 9.
I tried other Swing applications in the past in my high resolution monitor.
But that is a good observation!
I will give a try with IPED tomorrow.
Depending on the results, maybe a simpler solution is possible (still allowing to increase/decrease fonts), or even just close this and wait for Java 9 support.

from iped.

wladimirleite avatar wladimirleite commented on May 29, 2024

I will give a try with IPED tomorrow. Depending on the results, maybe a simpler solution is possible (still allowing to increase/decrease fonts), or even just close this and wait for Java 9 support.

I ran several tests with JREs >= 9.
The results are very good (especially texts), much better than the simple upscaling solution available for Java 8.
In my 4K large monitor, fonts are a bit larger than I would like.

Running the new version (in which font size can be set), the results were similar, slightly better on icons and in some controls texts.
Looking very closely, the auto scaled version is a bit worse (vertical lines are 1 pixel shifted down, "o" of "Texto" was cutted in the right):
image

A few advantages that I see in using the dpi-aware approach:

  • Works with Java 8 (and >= 9). Just a "temporary" advantage, while full support to newer Java versions is not added.
  • Slightly better visual results.
  • Allow font "static" adjustment to user preferences.
  • More "compact" UI (space between many controls seem larger than necessary in the automatic scaling, as it can be seen in the picture above).

Disadvantage:

  • Requires code changes!
    Well, it is not that much, and most of it is done already and concentrated in ThemeManager and UiUtil classes.
    In other places, I think there is not much complexity added.
    Basically, calls to setBounds(new Dimension(x, y, w, h)) where replaced by setBounds(UiUtil.scale(x, y, w, h)).
    So future changes in the GUI shouldn't be harder because of this.

@lfcnassif, I will finish the changes n the next week and make a draft pull request so you can run it, evaluate the visual results, code complexity and decide if it is better to keep it or not.

from iped.

wladimirleite avatar wladimirleite commented on May 29, 2024

Thanks for the reply @lfcnassif!
I will start working on moving the minor UI improvements to a specific branch.

from iped.

wladimirleite avatar wladimirleite commented on May 29, 2024

As discussed here, this feature will not be implemented.
Instead, Java automatic scaling will be used, when full support to Java newer versions (>= 9) is added.

from iped.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.