1 Subject: "transient" support for ColoredWinMenu patch
5 doc/help.etx | 6 +++++-
6 source/menu.c | 5 +++++
7 source/preferences.c | 16 ++++++++++++++++
8 source/preferences.h | 2 ++
9 4 files changed, 28 insertions(+), 1 deletion(-)
11 diff --quilt old/doc/help.etx new/doc/help.etx
14 @@ -4623,14 +4623,18 @@ X Resources
16 **nedit.readOnlyWinMenuColor**: blue
18 Defines the color of read-only files in the Windows menu.
20 +**nedit.transientWinMenuColor**: yellow
22 + Defines the color of transient files in the Windows menu.
24 **nedit.backgroundWinMenuColor**: white
26 Defines the color of the background used for colored Windows menu items
27 - when using either the modified or read-only foreground color.
28 + when using either the modified, read-only or transient foreground color.
30 **nedit.multiClickTime**: (system specific)
32 Maximum time in milliseconds allowed between mouse clicks within double and
34 diff --quilt old/source/menu.c new/source/menu.c
37 @@ -4450,10 +4450,11 @@ static void setTransientAP(Widget text,
38 XmToggleButtonSetState(window->transientItem, window->transient, False);
41 UpdateWindowTitle(window);
42 RefreshTabState(window);
43 + InvalidateWindowMenus();
46 static void setTabDistAP(Widget w, XEvent *event, String *args,
49 @@ -4845,10 +4846,14 @@ static void colorWindowMenuEntries(const
51 if (IS_ANY_LOCKED(window->lockReasons)) {
52 color = GetPrefRoMenuColor(&colorLength);
53 bgcolor = GetPrefBgMenuColor(&bgcolorLength);
55 + else if (window->transient == TRUE) {
56 + color = GetPrefTransMenuColor(&colorLength);
57 + bgcolor = GetPrefBgMenuColor(&bgcolorLength);
59 else if (window->fileChanged == TRUE) {
60 color = GetPrefModMenuColor(&colorLength);
61 bgcolor = GetPrefBgMenuColor(&bgcolorLength);
64 diff --quilt old/source/preferences.c new/source/preferences.c
65 --- old/source/preferences.c
66 +++ new/source/preferences.c
67 @@ -367,10 +367,12 @@ static struct prefData {
68 int roMenuColorLength;
69 char defMenuColor[MAX_COLOR_LENGTH];
70 int defMenuColorLength;
71 char bgMenuColor[MAX_COLOR_LENGTH];
72 int bgMenuColorLength;
73 + char transMenuColor[MAX_COLOR_LENGTH];
74 + int transMenuColorLength;
77 /* Temporary storage for preferences strings which are discarded after being
80 @@ -1211,10 +1213,12 @@ static PrefDescripRec PrefDescrip[] = {
81 PrefData.roMenuColor, (void *)sizeof(PrefData.roMenuColor), False},
82 {"defaultWinMenuColor", "DefaultWinMenuColor", PREF_STRING, "black",
83 PrefData.defMenuColor, (void *)sizeof(PrefData.defMenuColor), False},
84 {"backgroundWinMenuColor", "BackgroundWinMenuColor", PREF_STRING, "white",
85 PrefData.bgMenuColor, (void *)sizeof(PrefData.bgMenuColor), False},
86 + {"transientWinMenuColor", "TransientWinMenuColor", PREF_STRING, "yellow",
87 + PrefData.transMenuColor, (void *)sizeof(PrefData.transMenuColor), False},
90 static XrmOptionDescRec OpTable[] = {
91 {"-wrap", ".autoWrap", XrmoptionNoArg, (caddr_t)"Continuous"},
92 {"-nowrap", ".autoWrap", XrmoptionNoArg, (caddr_t)"None"},
93 @@ -1579,10 +1583,11 @@ static void translatePrefFormats(int con
94 /* For efficiency, precalculate the lengths of window menu colors */
95 SetPrefModMenuColorLength(PrefData.modMenuColor);
96 SetPrefRoMenuColorLength(PrefData.roMenuColor);
97 SetPrefDefMenuColorLength(PrefData.defMenuColor);
98 SetPrefBgMenuColorLength(PrefData.bgMenuColor);
99 + SetPrefTransMenuColorLength(PrefData.transMenuColor);
101 /* setup language mode dependent info of user menus (to increase
102 performance when switching between documents of different
105 @@ -2385,10 +2390,21 @@ const char *GetPrefBgMenuColor(int* leng
106 void SetPrefBgMenuColorLength(const char* string)
108 PrefData.bgMenuColorLength = strlen(string);
111 +const char *GetPrefTransMenuColor(int* length)
113 + *length = PrefData.transMenuColorLength;
114 + return PrefData.transMenuColor;
117 +void SetPrefTransMenuColorLength(const char* string)
119 + PrefData.transMenuColorLength = strlen(string);
122 int GetPrefOverrideVirtKeyBindings(void)
124 return PrefData.virtKeyOverride;
127 diff --quilt old/source/preferences.h new/source/preferences.h
128 --- old/source/preferences.h
129 +++ new/source/preferences.h
130 @@ -201,10 +201,12 @@ const char *GetPrefRoMenuColor(int* leng
131 void SetPrefRoMenuColorLength(const char* string);
132 const char *GetPrefDefMenuColor(int* length);
133 void SetPrefDefMenuColorLength(const char* string);
134 const char *GetPrefBgMenuColor(int* length);
135 void SetPrefBgMenuColorLength(const char* string);
136 +const char *GetPrefTransMenuColor(int* length);
137 +void SetPrefTransMenuColorLength(const char* string);
138 void SetPrefFindReplaceUsesSelection(int state);
139 int GetPrefFindReplaceUsesSelection(void);
140 int GetPrefStickyCaseSenseBtn(void);
141 void SetPrefBeepOnSearchWrap(int state);
142 int GetPrefBeepOnSearchWrap(void);