g0orx / linhpsdr

Linux HPSDR
GNU General Public License v3.0
74 stars 45 forks source link

Mouse scroll changes wrong freq digit. #49

Open imoldovavan opened 4 years ago

imoldovavan commented 4 years ago

The mouse wheel changes the wrong digit when I try to change frequency by scrolling. Using the lates comit. The interface looks good. Manjaro Linux. 4.19.97-1-MANJARO

m5evt commented 4 years ago

I believe this is now fixed in this pull request #50

sq8mvy commented 4 years ago

pull request #50 still not fixed mouse scroll changes.

m5evt commented 4 years ago

Could you provide some more information please? My understanding of this was that placing the mouse over the frequency in the VFO display at the top of the screen, the mouse wheel did not scroll correctly through the frequencies. If this is the issue you observe still after a fresh clone, can you provide some information about OS, which radio you are using etc?

sq8mvy commented 4 years ago

Please, look at my movie -> https://drive.google.com/open?id=1-Mhk6IEJN0hW_JrO16hOsaOMRPJOm1kr Coordinate calculations are not adapted to the new font width. Before changing the VFO font, scrolling worked correctly. Linux Mint 19.3 and Kubuntu i'm using google translator, my english is poor.

g0orx commented 4 years ago

This problem is caused by the change to use the Overpass font face for the VFO frequency. It requires the Overpass font to be installed. If it is not then installed it uses another font face but the mapping for the scroll wheel do not match. -- John g0orx

m5evt commented 4 years ago

Thanks both. I originally changed this on a machine with overpass installed. I have since changed dev machine. This machine doesn't have overpass installed. I have just tried:

cairo_select_font_face(cr, "blah_blah_blah", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);

it compiled and ran fine. I suspect cairo silently goes to some system default if it can't find the font. Confirmed here (in the description of the "toy" text API):

https://www.cairographics.org/manual/cairo-text.html

I've just tested a few different Linux VMs and none had overpass as default. This is not good and I will remove overpass. I will look for a suitable font in various flavours of Ubuntu and one that works on Mac. Then I will update scroll wheel mapping.

sq8mvy commented 4 years ago

I installed the Overpass font from https://overpassfont.org The Overpass font is not a fixed width font. The "Overpass mono" font has a fixed width. The Overpass font is not installed by default in LinuxMint and Kubuntu. Linhpsdr picture with the "Overpass mono" font Linhpsdr_font_Overpass_mono

m5evt commented 4 years ago

Thanks, I will fix this.

m5evt commented 4 years ago

I have selected Noto Mono. This seems to be the least bad looking monospace font that is more commonly available on ubuntu flavours. I've tested this on Ubuntu 19.10, kubuntu 18.04 and lubuntu 18.04. I have yet to test on a mac, but it seems to be possible for mac too. If it is not available on a mac, the cairo default mono font might work anyway.

Please could you test the latest commit in this fork:

https://github.com/m5evt/linhpsdr

sq8mvy commented 4 years ago

The font looks good. Changing the VFO with the mouse is now correct. No empty space for invisible preceding numbers, which doesn't look good. VFO shifts to the right after exceeding tens, hundreds or thousands of MHZ It is worth returning to the VFO presentation that was before the font change. Linhpsdr_VFO_font

I found a problem by accident. Changing the VFO at the visible position of the mouse cursor leads to this effect: VFO_error_mouse_scroll

m5evt commented 4 years ago

Until someone requests a change, the scroll is now locked to an upper limit of 99.999999 GHz.