buggins / dlangui

Cross Platform GUI for D programming language
Boost Software License 1.0
805 stars 120 forks source link

Fix #645, fix #673 #674

Closed Ermiq closed 12 months ago

Ermiq commented 12 months ago

Fix #673 where the function renameTab(string ID, dstring name) in src/dlangui/widgets/tabs.d failed to find the tab with the given id because it uses the TabControl's own id due to the misuse of lower/upper case names. Changed the function's argument ID that have never been used to id.

Fix #645 where EditWidgetBase doesn't scroll when mouse selection is active and the cursor goes beyond the widget boundaries. Now it scrolls. Additionally, added new type of EditorActions to make 2 different types of EditorActions.ScrollLineUp/Down. The old ScrollLineUp/Down made 3 lines scrolling and it doesn't work well with new mouse selection scrolling when out of bounds (scrolls too fast). So now there are ScrollLineUp/DownSingle and ScrollLineUp/DownTriple. The single one is used by the mouse selection scrolling, the triple one used in all other cases just like before.

Ermiq commented 12 months ago

Probably I should have kept the old ScrollLineUp/ScrollIneDown unchanged (not-renamed) and just add the new one as ScrollLIneUpSingle/ScrollLineDownSingle. Who knows, maybe someone uses the action names directly, and this commit will make them have to adapt their code. Yep. I'll add a new commit with the original ScrollLineUp/ScrollLineDown unchanged.

GrimMaple commented 12 months ago

Hi! Thank you for the fixes! I will merge your changes, however #645 is actually unfixed, because I really meant horizontal scrolling... and it's still broken even in your PR It would also be nice if you made 1 PR per 1 issue for history maintenance :)

Ermiq commented 12 months ago

Got it.
I will create another PR soon. I found out another way of enabling this selection scrolling, the proper way actually, using the ensureCaretVisible() function that makes the edit widget scroll appropriately to keep the caret visible when its position is changed. I'll also revert back the changes in editors.d file made in this PR because with the new approach they're not needed.