Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve UI and add keyboard shortcuts #67

Closed
paolostivanin opened this issue Apr 10, 2018 · 15 comments
Closed

improve UI and add keyboard shortcuts #67

paolostivanin opened this issue Apr 10, 2018 · 15 comments

Comments

@paolostivanin
Copy link
Owner

paolostivanin commented Apr 10, 2018

Evaluate switch to GtkListBox and global ui file:

  • cleaner ui
  • can be used on small screen (eg, librem 5)
  • accels can be easily added when using one single ui file
  • codebase becomes cleaner if the ui part is taken out
@paolostivanin paolostivanin added this to the 1.3.0 milestone Apr 10, 2018
@paolostivanin paolostivanin self-assigned this Apr 10, 2018
@paolostivanin paolostivanin changed the title switch to GtkListBox switch to GtkListBox and global ui file Apr 25, 2018
@gergelypolonkai
Copy link

I made a hasty implementation of the main window as a .ui file, using a GtkListBox. Feel free to use it if you like.

If you want, I can also make the code use it and send you a proper PR.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<interface>
  <requires lib="gtk+" version="3.20"/>
  <template class="main-window" parent="GtkApplicationWindow">
    <property name="can_focus">False</property>
    <property name="default_width">500</property>
    <property name="default_height">350</property>
    <property name="icon_name">otpclient</property>
    <child>
      <object class="GtkListBox" id="token-list">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
      </object>
    </child>
    <child type="titlebar">
      <object class="GtkHeaderBar" id="header">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="title">OTPClient 1.1.1</property>
        <child>
          <object class="GtkBox">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <child>
              <object class="GtkButton" id="remove-button">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="tooltip_text" translatable="yes">Add</property>
                <child>
                  <object class="GtkImage">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="icon_name">list-add-symbolic</property>
                  </object>
                </child>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="add-button">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="tooltip_text" translatable="yes">Remove</property>
                <child>
                  <object class="GtkImage">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="icon_name">list-remove-symbolic</property>
                  </object>
                </child>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">1</property>
              </packing>
            </child>
            <style>
              <class name="linked"/>
            </style>
          </object>
        </child>
        <child>
          <object class="GtkMenuButton" id="menu-button">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="receives_default">True</property>
            <child>
              <object class="GtkImage">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="icon_name">open-menu-symbolic</property>
              </object>
            </child>
          </object>
          <packing>
            <property name="pack_type">end</property>
            <property name="position">1</property>
          </packing>
        </child>
      </object>
    </child>
  </template>
</interface>

@paolostivanin
Copy link
Owner Author

paolostivanin commented Apr 27, 2018

Thanks for your help, always appreciated :)
I gave it a quick look and I spotted an error here: <property name="title">OTPClient 1.1.1</property>. The title is generated at runtime, so no need to hard-code the name and version here.

@gergelypolonkai
Copy link

Yes I know, I just added it for readability’s purpose :)

@paolostivanin paolostivanin changed the title switch to GtkListBox and global ui file evaluate switch to GtkListBox May 22, 2018
@paolostivanin paolostivanin changed the title evaluate switch to GtkListBox evaluate switch to GtkListBox and use global ui file May 22, 2018
@paolostivanin
Copy link
Owner Author

paolostivanin commented May 22, 2018

Another alternative would be to keep the current UI and improving it by:

  • removing the tick column
  • when row is selected otp is shown and copied to the clipboard
  • when otp column is double clicked otp value is copied to the clipboard
  • moving the countdown to a separate column with an empty value when type is hotp

@gergelypolonkai
Copy link

I was about to open a discussion about copying the code even if the checkbox is not ticked. You were faster :)

Also, it would look nice if the TOTP countdown would be a decreasing progress bar instead of the current GtkLabel.

@paolostivanin
Copy link
Owner Author

Yes, I also thought about that. I was thinking about having a "pie progress" instead of the usual progress bar, but I couldn't find anything like that on gtk. I guess I'll stick with the plain old progress bar then :)

Sent from my Aquaris X Pro using FastHub

@gergelypolonkai
Copy link

There’s a (seemingly abandoned) project called gnome-break-timer; they used a custom widget as the progress bar. It is written in Vala, but it seems straightforward to implement in C.

@paolostivanin
Copy link
Owner Author

paolostivanin commented May 22, 2018

Thanks for link! I'll have a look at it :)

Sent from my Aquaris X Pro using FastHub

@paolostivanin
Copy link
Owner Author

paolostivanin commented May 27, 2018

I'm not convinced that a circle counter/progress bar widget would be better than a plain text counter here. The widget would be very small and, therefore, more difficult to interpret compared to a simple countdown label.

@paolostivanin paolostivanin changed the title evaluate switch to GtkListBox and use global ui file improve UI and add keyboard shortcuts May 27, 2018
@gergelypolonkai
Copy link

How about a progress bar then? A thin one like some web apps use nowadays, not a full thick one.

@paolostivanin
Copy link
Owner Author

I'll try it and see how it will look like :)
But I think I will add a new setting in the menu, so everyone will be able to choose between label and widget 👍

@gergelypolonkai
Copy link

Also, what will it look like for codes that use 60s htimeout instead of 30? FreeOTP+ solves it by not displaying a global timer, but one for every code. However, when you reveal multiple codes, it is rather annoying (although why on earth would you do that?)

@paolostivanin
Copy link
Owner Author

Actually it won't look at all. I still have to implement the support for 60s codes. I had it in mind, but then I completely forgot about it. Thank you for reminding me 👍

The global timer will be gone with version 1.3.0. I'm planning to add an additional column with a counter for each row. It's a bit uglier than now to have so many redundant counters, but

  1. how many code does someone input at the same time (or in a short timeframe)? Maybe 2 or 3
  2. HOTPs don't need a timer, so right now the global one is a bit confusing
  3. there will be support also 60s tokens, so the global one won't make any sense
  4. the counter(s) will be hidden by default

@gergelypolonkai
Copy link

  1. this is only valid if the checkbox gets automatically unticked after some periods of time; if I have to untick it manually, it is possible that I will end up having a lot of visible codes.
  2. indeed. Even though I don’t use HOTP, I can imagine how confusing it can be
  3. see the previous point
  4. that’s a good idea

I begin to feel a bit embarrassed to always mention it, but FreeOTP+ solves it pretty good to only display timers when the code is displayed. When you tap on a code, two timers get visible. The inner circle counts down until the current code is valid. The outer timer counts down until a code is visible on the screen, which is basically this code and the next one; if that timer ends, the code gets automatically hidden. I’m not sure it’s a good idea for a desktop app, but the idea behind it is pretty good (for me.)

@paolostivanin
Copy link
Owner Author

Ahahah no problem! Feedbacks are always more than welcome :)
Mmm, I could implement something like that...maybe as an additional setting like, for example, "number of cycles the token will stay visible"

@paolostivanin paolostivanin added this to In progress in Release 1.3.0 Jul 6, 2018
@paolostivanin paolostivanin moved this from In progress to Done in Release 1.3.0 Oct 7, 2018
paolostivanin added a commit that referenced this issue Oct 18, 2018
- fix #67
- fix #68
- fix #86
- fix #89
- fix #90
- fix #91
- fix #104
- fix #106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Release 1.3.0
  
Done
Development

No branches or pull requests

2 participants