elm fileselector - make ok/cancel in selector configurable per os
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 2 Jun 2016 09:37:06 +0000 (18:37 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Thu, 2 Jun 2016 09:38:57 +0000 (18:38 +0900)
so the theme build can order ok/cancel based on preference for an os,
so make configure have an option for this and build the theme
specifically based on that option. enable the option if you want mac
style cancel, ok or default ok, cancel as is common elsewhere.

  --enable-cancel-ok

is the option

@feature

configure.ac
data/elementary/themes/Makefile.am
data/elementary/themes/edc/elm/fileselector.edc

index 3eef79c..875968d 100644 (file)
@@ -5516,6 +5516,17 @@ AC_SUBST([ELEMENTARYJS_CXXFLAGS])
 EFL_LIB_END_OPTIONAL([ELEMENTARY_JS])
 #### End of Efl_Js
 
+ELM_EDJE_DEFINES=""
+AC_ARG_ENABLE([cancel-ok],
+              [AS_HELP_STRING([--enable-cancel-ok],[Enable ordering of cancel and ok buttons to be cancel first, then ok instead of ok then cancel. @<:@default=disabled@:>@])],
+              [
+                if test "x${enableval}" = "xyes" ; then
+                    ELM_EDJE_DEFINES="$ELM_EDJE_DEFINES -DELM_CANCEL_OK=1"
+                fi
+              ],[])
+AC_SUBST(ELM_EDJE_DEFINES)
+
+
 ## Disable warning for OS that have a specifc configuration
 case "$host_os" in
    mingw*|cygwin*)
index 40a2000..662bce9 100644 (file)
@@ -1,4 +1,5 @@
 EDJE_CC_ELM_FLAGS = \
+@ELM_EDJE_DEFINES@ \
 -id $(top_srcdir)/data/elementary/themes/img \
 -id $(top_srcdir)/data/elementary/themes/fdo \
 -fd $(top_srcdir)/data/elementary/themes/fnt \
index be2eb00..ac7208b 100644 (file)
@@ -54,8 +54,12 @@ group { name: "elm/fileselector/base/default";
             }
          }
       }
+#ifdef ELM_CANCEL_OK
       swallow { "elm.swallow.ok";
-         description { state: "default" 0.0;
+#else
+      swallow { "elm.swallow.cancel";
+#endif
+         desc { "default";
             align: 1.0 1.0;
             fixed: 1 1;
             rel1.relative: 1.0 1.0;
@@ -64,17 +68,29 @@ group { name: "elm/fileselector/base/default";
             rel2.offset: -4 -4;
          }
       }
+#ifdef ELM_CANCEL_OK
       swallow { "elm.swallow.cancel";
+#else
+      swallow { "elm.swallow.ok";
+#endif
          desc { "default";
             align: 1.0 0.5;
             fixed: 1 0;
             rel1 {
+#ifdef ELM_CANCEL_OK
                to: "elm.swallow.ok";
+#else
+               to: "elm.swallow.cancel";
+#endif
                relative: 0.0 0.0;
                offset: -4 0;
             }
             rel2 {
+#ifdef ELM_CANCEL_OK
                to: "elm.swallow.ok";
+#else
+               to: "elm.swallow.cancel";
+#endif
                relative: 0.0 1.0;
                offset: -4 -1;
             }