Notepads icon indicating copy to clipboard operation
Notepads copied to clipboard

feat: exit app when closing last tab

Open soumyamahunt opened this issue 4 years ago • 20 comments

Implemented functionality to exit app when last tab is closed as requested in #248.

PR Type

What kind of change does this PR introduce?

  • Feature

Other information

The implemented method doesn't interfere with Windows' ability to remember window size and position.

W13JDdBKCD

M3mIjjDjVO

soumyamahunt avatar Jun 24 '20 11:06 soumyamahunt

Never realized there is a method called "TryConsolidateAsync" and does exactly what is needed. How did you figure that out?

0x7c13 avatar Jun 24 '20 15:06 0x7c13

Never realized there is a method called "TryConsolidateAsync" and does exactly what is needed. How did you figure that out?

Just by reading documentation.

soumyamahunt avatar Jun 24 '20 16:06 soumyamahunt

Since it has been too long that I changed this behavior (it used to be like this). Maybe we should add this as an option in Advanced Settings? Default would be not to close the app and let's give the option to user.

0x7c13 avatar Jun 24 '20 23:06 0x7c13

Since it has been too long that I changed this behavior (it used to be like this). Maybe we should add this as an option in Advanced Settings? Default would be not to close the app and let's give the option to user.

Made changes as you asked, here is how the ui looks:

ApplicationFrameHost_NvKe4ul4Ys

soumyamahunt avatar Jun 25 '20 12:06 soumyamahunt

I had a go at that myself, but didn't know about TryConsolidateAsync(), very nice. +1 for merging this. I'll happily supply German translations when this gets to master.

avgrad avatar Jun 25 '20 16:06 avgrad

@JasonStein is there any further work you need from me here or is it RTM??

soumyamahunt avatar Mar 22 '21 09:03 soumyamahunt

@JasonStein is there any further work you need from me here or is it RTM??

image I don't like the translation here since it is not very user-friendly (maybe just App Preference and Exit when closing the last tab?). Let me think of any better wording here before merging the PR. Btw I will probably put this in the next release.

0x7c13 avatar Mar 22 '21 17:03 0x7c13

Some Suggestions for the wording:

  • "App Behavior Preferences"
  • "Window Behavior Preferences"
  • "Exit app when closing last tab"

avgrad avatar Mar 22 '21 18:03 avgrad

  • "Window Behavior Preferences"
  • "Exit app when closing last tab"

LGTM. @soumyamahunt thoughts?

0x7c13 avatar Mar 22 '21 19:03 0x7c13

  • "Window Behavior Preferences"
  • "Exit app when closing last tab"

LGTM. @soumyamahunt thoughts?

Fine with this, but I think "Always open new window" conveys better meaning than "Window Behavior Preferences".

soumyamahunt avatar Mar 23 '21 03:03 soumyamahunt

This is how it looks now after the changes:

ApplicationFrameHost_lBRJmctwa3

soumyamahunt avatar Mar 23 '21 03:03 soumyamahunt

The description below the switches is confusing. Its a single sentence, describing two independent settings. When I read it, it appears to me, that "closing the last tab" will also somehow enable "always open in new window".

I think it should be split up to describe the options seperately, or maybe we should just omit the description of "Exit app when closing last tab", since the title explains it well enough.

avgrad avatar Mar 23 '21 07:03 avgrad

The description below the switches is confusing. Its a single sentence, describing two independent settings. When I read it, it appears to me, that "closing the last tab" will also somehow enable "always open in new window".

I think it should be split up to describe the options seperately, or maybe we should just omit the description of "Exit app when closing last tab", since the title explains it well enough.

Yes this could create confusion, I have removed description for last tab closing option.

ApplicationFrameHost_2KwZd6pcKg

soumyamahunt avatar Mar 23 '21 09:03 soumyamahunt

What about moving the description to beneath the first switch, and have the description change depending on whether the switch is on or off. If the switch is on it reads The app is automatically closed when there are no open tabs.. If the switch is off it reads The app stays open when there are no open tabs.

UmbralReaper avatar Mar 31 '21 03:03 UmbralReaper

What about moving the description to beneath the first switch, and have the description change depending on whether the switch is on or off. If the switch is on it reads The app is automatically closed when there are no open tabs.. If the switch is off it reads The app stays open when there are no open tabs.

Notepads doesn't follow different content depending on whether switch is on or off. Doing that only for this will create confusion. Also, I personally think this type of changing content whether switch is on/off creates more confusion for user. In your example when the user toggles it on it reads The app is automatically closed when there are no open tabs. does that mean currently this behavior applied or when user toggles switch off the behavior is applied, which creates confusion.

soumyamahunt avatar Mar 31 '21 04:03 soumyamahunt

Notepads doesn't follow different content depending on whether switch is on or off. Doing that only for this will create confusion. Also, I personally think this type of changing content whether switch is on/off creates more confusion for user.

I agree. I honestly don't know what I was thinking.

Regardless, the description text should be moved to under the button it corresponds to.

UmbralReaper avatar Mar 31 '21 05:03 UmbralReaper

Regardless, the description text should be moved to under the button it corresponds to.

Currently the new toggle switch doesn't contain any description as the content itself pretty self explanatory, as for the "always open new window" option the description for it is below it.

soumyamahunt avatar Mar 31 '21 05:03 soumyamahunt

Currently the new toggle switch doesn't contain any description as the content itself pretty self explanatory, as for the "always open new window" option the description for it is below it.

Turns out I was reading it the wrong way round 😅 .

UmbralReaper avatar Mar 31 '21 05:03 UmbralReaper

Why has this functionality not been applied yet?

LucaSorvillo avatar Sep 30 '21 17:09 LucaSorvillo

Any updates on this? Will it be added to a release soon?

philippehawi avatar Feb 20 '22 00:02 philippehawi