This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  d9ea6f0e258e85824d543603dc7a1dda2823dd34 (commit)
       via  fa821810cf9b0039c528e78205d2595ba8dc4dc0 (commit)
      from  443a08ea1683adc3d6ea0811f44e85762033deb2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/d9ea6f0e258e85824d543603dc7a1dda2823dd34

commit d9ea6f0e258e85824d543603dc7a1dda2823dd34
Author: Doug Torrance <dtorra...@monmouthcollege.edu>
Date:   Tue Jun 23 19:35:00 2015 -0500

    WPrefs: Add snap edge and corner detect to Expert panel.
    
    These are both integer values, and thus use the new OPTION_WMAKER_INT class.
    We also update the text describing the window snapping feature for
    clarification and consistency.

diff --git a/NEWS b/NEWS
index d60603c..36fb3f4 100644
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,9 @@ Window snapping
 
 You can now "snap" a window, i.e., maximize it to a side or corner of the
 screen, by dragging it to that side or corner.  It is enabled by setting
-"WindowSnapping = YES" in ~/GNUstep/Defaults/WindowMaker or selecting "Enable
-window snapping" under "Expert User Preferences" in WPrefs.app.
+"WindowSnapping = YES" in ~/GNUstep/Defaults/WindowMaker or selecting "Maximize
+(snap) a window to edge or corner by dragging." under "Expert User Preferences"
+in WPrefs.app.
 
 Note that if "Switch workspaces while dragging windows" is selected under
 "Workspace Preferences" in WPrefs.app, or if "DontLinkWorkspaces = NO" in
@@ -19,8 +20,9 @@ bottom of the screen.
 
 You may set the distance (in pixels) from the edge or corner of the screen at
 which a window will begin snapping using "SnapEdgeDetect" and 
"SnapCornerDetect"
-in ~/GNUstep/Defaults/WindowMaker.  (The defaults are 1 pixel and 10 pixels,
-respectively).
+in ~/GNUstep/Defaults/WindowMaker or setting "Distance from edge/corner to 
begin
+window snap." under "Expert User Preferences" in WPrefs.app.  (The defaults are
+1 pixel and 10 pixels, respectively).
 
 
 Dragging maximized windows
diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c
index 0c6ed7b..616f9ec 100644
--- a/WPrefs.app/Expert.c
+++ b/WPrefs.app/Expert.c
@@ -88,9 +88,15 @@ static const struct {
          /* default: */ False, OPTION_WMAKER, "KbdModeLock" },
 #endif /* XKB_MODELOCK */
 
-       { N_("Maximize a window to side or corner by dragging."),
+       { N_("Maximize (snap) a window to edge or corner by dragging."),
          /* default: */ False, OPTION_WMAKER, "WindowSnapping" },
 
+       { N_("Distance from edge to begin window snap."),
+         /* default: */ 1, OPTION_WMAKER_INT, "SnapEdgeDetect" },
+
+       { N_("Distance from corner to begin window snap."),
+         /* default: */ 10, OPTION_WMAKER_INT, "SnapCornerDetect" },
+
        { N_("Open dialogs in the same workspace as their owners."),
          /* default: */ False, OPTION_WMAKER, "OpenTransientOnOwnerWorkspace" }
 

http://repo.or.cz/w/wmaker-crm.git/commit/fa821810cf9b0039c528e78205d2595ba8dc4dc0

commit fa821810cf9b0039c528e78205d2595ba8dc4dc0
Author: Doug Torrance <dtorra...@monmouthcollege.edu>
Date:   Tue Jun 23 19:34:59 2015 -0500

    WPrefs: Add ability to set integer values in Expert panel
    
    Previously, only boolean values could be changed using the Expert panel.
    This patch adds the ability to change integer values.  A new class,
    OPTION_WMAKER_INT, is added.  When this class is used, a textfield and two
    buttons (up and down) appear instead of a checkbox.  Users can either type
    the integer value or increment/decrement it using the arrows.

diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c
index 6db1dfa..0c6ed7b 100644
--- a/WPrefs.app/Expert.c
+++ b/WPrefs.app/Expert.c
@@ -33,7 +33,8 @@ static const struct {
        enum {
                OPTION_WMAKER,
                OPTION_WMAKER_ARRAY,
-               OPTION_USERDEF
+               OPTION_USERDEF,
+               OPTION_WMAKER_INT
        } class;
 
        const char *op_name;  /* The identifier for the option in the config 
file */
@@ -96,6 +97,7 @@ static const struct {
 };
 
 
+
 typedef struct _Panel {
        WMBox *box;
        char *sectionName;
@@ -108,10 +110,37 @@ typedef struct _Panel {
 
        WMButton *swi[wlengthof_nocheck(expert_options)];
 
+       WMTextField *textfield[wlengthof_nocheck(expert_options)];
+
 } _Panel;
 
 #define ICON_FILE      "expert"
 
+static void changeIntTextfield(void *data, int delta)
+{
+       WMTextField *textfield;
+       char *text;
+       int value;
+
+       textfield = (WMTextField *)data;
+       text = WMGetTextFieldText(textfield);
+       value = atoi(text);
+       value += delta;
+       sprintf(text, "%d", value);
+       WMSetTextFieldText(textfield, text);
+}
+
+static void downButtonCallback(WMWidget *self, void *data)
+{
+       (void) self;
+       changeIntTextfield(data, -1);
+}
+
+static void upButtonCallback(WMWidget *self, void *data)
+{
+       (void) self;
+       changeIntTextfield(data, 1);
+}
 
 static void createPanel(Panel *p)
 {
@@ -137,11 +166,13 @@ static void createPanel(Panel *p)
 
        udb = WMGetStandardUserDefaults();
        for (i = 0; i < wlengthof(expert_options); i++) {
-               panel->swi[i] = WMCreateSwitchButton(f);
-               WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
-               WMMoveWidget(panel->swi[i], 5, 5 + i * 25);
+               if (expert_options[i].class != OPTION_WMAKER_INT) {
+                       panel->swi[i] = WMCreateSwitchButton(f);
+                       WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
+                       WMMoveWidget(panel->swi[i], 5, 5 + i * 25);
 
-               WMSetButtonText(panel->swi[i], _(expert_options[i].label));
+                       WMSetButtonText(panel->swi[i], 
_(expert_options[i].label));
+               }
 
                switch (expert_options[i].class) {
                case OPTION_WMAKER:
@@ -163,6 +194,49 @@ static void createPanel(Panel *p)
                        state = WMGetUDBoolForKey(udb, 
expert_options[i].op_name);
                        break;
 
+               case OPTION_WMAKER_INT:
+               {
+                       char tmp[10];
+                       WMButton *up, *down;
+                       WMLabel *label;
+
+                       panel->textfield[i] = WMCreateTextField(f);
+                       WMResizeWidget(panel->textfield[i], 41, 20);
+                       WMMoveWidget(panel->textfield[i], 22, 7 + i * 25);
+
+                       down = WMCreateCommandButton(f);
+                       WMSetButtonImage(down, 
WMGetSystemPixmap(WMWidgetScreen(down), WSIArrowDown));
+                       WMSetButtonAltImage(down,
+                                           
WMGetSystemPixmap(WMWidgetScreen(down), WSIHighlightedArrowDown));
+                       WMSetButtonImagePosition(down, WIPImageOnly);
+                       WMSetButtonAction(down, downButtonCallback, 
panel->textfield[i]);
+                       WMResizeWidget(down, 16, 16);
+                       WMMoveWidget(down, 5, 9 + i * 25);
+
+                       up = WMCreateCommandButton(f);
+                       WMSetButtonImage(up, 
WMGetSystemPixmap(WMWidgetScreen(up), WSIArrowUp));
+                       WMSetButtonAltImage(up, 
WMGetSystemPixmap(WMWidgetScreen(up), WSIHighlightedArrowUp));
+                       WMSetButtonImagePosition(up, WIPImageOnly);
+                       WMSetButtonAction(up, upButtonCallback, 
panel->textfield[i]);
+                       WMResizeWidget(up, 16, 16);
+                       WMMoveWidget(up, 64, 9 + i * 25);
+
+                       label = WMCreateLabel(f);
+                       WMSetLabelText(label, _(expert_options[i].label));
+                       WMResizeWidget(label, FRAME_WIDTH - 99, 25);
+                       WMMoveWidget(label, 85, 5 + i * 25);
+
+                       if (GetStringForKey(expert_options[i].op_name))
+                               state = 
GetIntegerForKey(expert_options[i].op_name);
+                       else
+                               state = expert_options[i].def_state;
+
+                       sprintf(tmp, "%d", state);
+                       WMSetTextFieldText(panel->textfield[i], tmp);
+
+                       break;
+               }
+
                default:
 #ifdef DEBUG
                        wwarning("export_options[%d].class = %d, this should 
not happen\n",
@@ -171,7 +245,8 @@ static void createPanel(Panel *p)
                        state = expert_options[i].def_state;
                        break;
                }
-               WMSetButtonSelected(panel->swi[i], state);
+               if (expert_options[i].class != OPTION_WMAKER_INT)
+                       WMSetButtonSelected(panel->swi[i], state);
        }
 
        WMMapSubwidgets(panel->box);
@@ -204,6 +279,18 @@ static void storeDefaults(_Panel *panel)
                case OPTION_USERDEF:
                        WMSetUDBoolForKey(udb, 
WMGetButtonSelected(panel->swi[i]), expert_options[i].op_name);
                        break;
+
+               case OPTION_WMAKER_INT:
+               {
+                       char *text;
+                       int value;
+
+                       text = WMGetTextFieldText(panel->textfield[i]);
+                       value = atoi(text);
+
+                       SetIntegerForKey(value, expert_options[i].op_name);
+                       break;
+               }
                }
        }
 }

-----------------------------------------------------------------------

Summary of changes:
 NEWS                |  10 +++--
 WPrefs.app/Expert.c | 107 ++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 106 insertions(+), 11 deletions(-)


repo.or.cz automatic notification. Contact project admin crma...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to