workbenchdev / Biblioteca

Documentation viewer for GNOME
GNU General Public License v3.0
51 stars 8 forks source link

Add find #106

Closed AkshayWarrier closed 2 months ago

AkshayWarrier commented 3 months ago

Closes #20

Depends on #108

sonnyp commented 3 months ago

Ctrl+f should refocus the input if the search overlay is already visible but has lost focus.

AkshayWarrier commented 3 months ago

The background shadow appears off compared to Text Editor

Yes I couldn't quite get the styling right and infact I was going to ask your help for design and styling :)

Especially in dark-mode I'm not exactly sure what I should be doing. Should it match the headerbar color and then a shadow using css?

image

I think we don't need the clear button?

Do you mean the close button?

It should show the number of occurrences and the current occurrence number. We have that in Workbench if you want to check how we do it

Yeah sure we can do that

This overlay deign is very cool - I might create an issue on Workbench to reuse it there if you don't mind. Might be a good internship task.

Yep, credits to @turtlegarden :)

Also another thing to think about is what should happen when Find is open and you switch tabs? Should we be maintaining a "search" state for each tab and then restore it when you switch to that particular tab? For example you have a tab with no search open, and one with search open with some text. I'll then also have to keep track of which occurrence of the word is highlighted.

sonnyp commented 3 months ago

Especially in dark-mode I'm not exactly sure what I should be doing. Should it match the headerbar color and then a shadow using css?

I think it looks fine in dark mode. Probably just the shadow should be adjusted.

This is what Text Editor uses (sorry no text copy there in the GTK inspector)

image

sonnyp commented 3 months ago

Do you mean the close button?

No, I mean the clear text button

image

sonnyp commented 3 months ago

Also another thing to think about is what should happen when Find is open and you switch tabs? Should we be maintaining a "search" state for each tab and then restore it when you switch to that particular tab? For example you have a tab with no search open, and one with search open with some text. I'll then also have to keep track of which occurrence of the word is highlighted.

Good question. I think I'd rather start with one search state per tab. So switching back and forth works well.

We can think of global search at some point.