nion-software / nionswift

Nion Swift is open source scientific image processing software integrating hardware control, data acquisition, visualization, processing, and analysis using Python. Nion Swift is easily extended using Python. It runs on Windows, Linux, and macOS.
http://nion.com/swift
GNU General Public License v3.0
44 stars 33 forks source link

Improve display panel title bar #1028

Open cmeyer opened 6 months ago

cmeyer commented 6 months ago
jamesrussell216 commented 3 months ago

@cmeyer quick question on this one - on your last two points why is it important to have that info in the title? Every piece of additional info that goes in there dilutes what I'd argue is the important information - the actual title. Surely having that info in the Inspector is sufficient?

cmeyer commented 3 months ago

It already shows up as a tool-tip - but I think having the "space used" would be helpful.

jamesrussell216 commented 3 months ago

What do you mean by "spaced used" @cmeyer ? Do you mean literally using the space because it's there?

cmeyer commented 3 months ago

Something like "45MB" meaning 45MB used on disk.

If we add compression storage, we might want something like "45MB disk/90MB memory" meaning "45MB storage on disk" but "90MB when loaded in memory". I know that could be confusing, so I'm open to other ideas, but both are valid/useful pieces of information. Note: the memory usage is difficult to quantify since HDF5 files are memory mapped and don't necessarily use RAM.

An alternative to the memory memory is to have something like Firefox and Chrome have, which is a window that shows resources being used, i.e. if memory is being used.

In any case, this sounds like a different issue that shouldn't go into the title bar. I've edited the top comment to remove that part of the request.

cmeyer commented 3 months ago

I had experimented with this, but seemingly didn't keep anything other than this minimal code snippet to experiment with:

diff --cc nion/swift/Panel.py
index a8aa52c3,a8aa52c3..9c50c3b3
--- a/nion/swift/Panel.py
+++ b/nion/swift/Panel.py
@@@ -440,7 -440,7 +440,7 @@@ class HeaderCanvasItem(CanvasItem.Canva
                  drawing_context.text_align = 'center'
                  drawing_context.text_baseline = 'bottom'
                  drawing_context.fill_style = '#000'
--                drawing_context.fill_text(self.title, canvas_size.width // 2, canvas_size.height - self.__text_offset)
++                drawing_context.fill_text(self.title + " \N{LOWER RIGHT PENCIL}", canvas_size.width // 2, canvas_size.height - self.__text_offset)
jamesrussell216 commented 2 months ago

Notes:

@Tiomat85 has put in a PR for the edit functionality so hopefully we can tick that off.

Other items on here are styling questions - we will have some trouble doing the MacOS one as we don't have macs! How do we want to handle this from an Issue admin point of view? We can go and move the title to be left aligned (@cmeyer - is that just for Windows or MacOS as well? I'm guessing the former but want to check) we can do the Windows side but you might need to pick up the MacOS side!