#1006: inconsistent behavior of Revert button in Backgrounds preflet (easy) -------------------------------------+-------------------------------------- Reporter: wkornewald | Owner: Type: bug | Status: new Priority: low | Milestone: R1 Component: Preferences/Backgrounds | Version: R1/pre-alpha1 Keywords: | Platform: All Blockedby: | Patch: 0 Blocking: | -------------------------------------+-------------------------------------- Comment(by stippi): Thanks for the new patch, now it was generally ok, though there were some places where you introduced whitespace at the end of lines or changed spacing unnecessarily. Most of the cleanup was ok, though. Thanks! However, I have applied the patch here locally, and I find the new behavior worse than before, even though I agree with this ticket: In the current Backgrounds preflet: * Revert will be enabled as soon as you change anything in the current workspace. * Apply will be enabled the same way. * When you make some changes, and then switch to another workspace, Apply and Revert get disabled again, the changes are completely forgotten and when you switch back to the workspace with changes, the original settings are reflected in the GUI. * When you click Apply, all is back to zero, the new settings are treated in just the same way as if the panel was closed and reopenened. The last point is what this ticket is about. In any case, the behavior as is, is at least consistent. With the patch applied, the behavior becomes a little weird: * When you make changes without applying them and switch to another workspace, the button state is inconsistent, since you can apparently "Revert", even though no settings have changed for the new workspace. * When you press Revert on the other workspace, nothing happens and when you switch back to the inital workspace with the changes, Revert is enabled, you can press it and now the settings are reverted to the initial state when the panel opened. * Apply is initially not enabled when you open the panel, as expected. * As soon as you make a change and revert it, Apply stays enabled. So all in all, the patch improves something (solves this ticket), but overall the behavior of the enabling/disabling of the buttons is now more confusing. IMHO, what should happen is that the code separates settings per workspace. For this I would introduce three sets of values: intial, changed and current. When the panel is opened, and when you switch to a workspace, one new set of values for this workspace is instantiated. The "initial" values are easy to assign, and it happens only once. The "current" set of values reflect the workspace as the user can see it on the screen. The "changed" values are adopted from the changes the user makes in UI. The Revert button is then enabled when either the current OR the changed values are unequal to the initial values. The Apply button is enabled whenever the current and changed values are not the same. There could be a third button "Undo" which is just enabled at the same time as Apply, and reverts the "changed" set to the "current" set. Just as Apply would adopt the settings for real and thereby assign the "changed" set to the "current" set. In other words, Undo would do what Revert does int he current panel. -- Ticket URL: <http://dev.haiku-os.org/ticket/1006#comment:24> Haiku <http://dev.haiku-os.org> Haiku - the operating system.