Opened 3 years ago

Last modified 15 months ago

#6350 new enhancement

Quality of life improvement for the file name path in the replay menu

Reported by: Langbart Owned by:
Priority: If Time Permits Milestone: Backlog
Component: UI & Simulation Keywords:
Cc: Patch: Phab:D4296, Phab:D4329

Description (last modified by Langbart)

Currently the path to the file name is displayed in a readonly input field. This has been introduced with [20075] so that you can select and copy the file path.

(1) Either add an option to disable the blinking cursor in the input field and maybe add some color. Right now the way the filename path is displayed is too merged with the replay list, it should look a bit more differentiated. [25976]

OR/ AND

(2) Turn it back into a text type field and add a "Copy" button and even an "Open" button to it.

Some info about the implementation of the copy/open button:

[19:04:05] elexis so an idea to make such a button could be that one introduces (A) a GUI accessible JS function in C++ that takes 1 string argument and writes this string into clipboard, then (B) is only adding a conventional button that calls this function
[19:04:29] elexis I find this:
[19:04:29] elexis gui/ObjectTypes/CInput.cpp: SDL_SetClipboardText(text.ToUTF8().c_str());
[19:06:52] elexis and such a function would be added somewhere in source/gui/Scripting/ScriptFunctions.cpp, I guess in source/gui/Scripting/JSInterface_GUIManager.cpp
[19:07:46] elexis there are 3 calls to SDL_SetClipboardText already, so it seems such a C++ patch would be something like 5 lines of code

[18:52:20] elexis (00:53:43) elexis: it calls sys_open_url
[18:52:20] elexis (00:54:44) vladislav: It uses xdg-open
[18:52:44] elexis "If a URL is provided the URL will be opened in the user's preferred web browser. If a file is provided the file will be opened in the preferred application for files of that type."
[18:52:48] elexis https://linux.die.net/man/1/xdg-open
[18:56:13] elexis important to notice that if there is a security concern with OpenURL, then it has been there since years

It would be good if this problem could be fixed before implementing this feature:

Attachments (1)

buttons_are_great.jpg (40.2 KB ) - added by Langbart 3 years ago.

Download all attachments as: .zip

Change History (10)

by Langbart, 3 years ago

Attachment: buttons_are_great.jpg added

comment:1 by Langbart, 3 years ago

Owner: set to Langbart
Patch: Phab:D4296

comment:2 by Silier, 3 years ago

Either add an option to disable the blinking cursor in the input field

This is actually bug, there is supposed to be no blinking cursor if you cant edit the value of the field

comment:3 by Freagarach, 2 years ago

In 25976:

Some layout changes to the replay menu.

Cursor should not blink in read-only.
The path was too similar to the list and thus easy to miss, it has been changed to a 'golden' colour.
A tooltip was added to the path.
The border colour of input fields was changed from white to gold.
The buttons at the bottom of the page are spread evenly.

Patch by: @Langbart
Differential revision: https://code.wildfiregames.com/D4296
Refs: #6350

comment:4 by Langbart, 2 years ago

Description: modified (diff)

Adding some additional information to the ticket about the implementation of copy/open buttons.

comment:5 by Langbart, 2 years ago

Patch: Phab:D4296Phab:D4296, Phab:D4329

added patch number for copy/open button

comment:6 by Langbart, 2 years ago

Description: modified (diff)

adding related issue to the description

comment:7 by Stan, 2 years ago

Milestone: Alpha 26Alpha 27

Unlikely to get done for A26

comment:8 by Freagarach, 16 months ago

Milestone: Alpha 27Backlog

Pushing back.

comment:9 by Stan, 15 months ago

Owner: Langbart removed
Note: See TracTickets for help on using tickets.