summaryrefslogtreecommitdiff
path: root/stardict/patches/050-split-the-index-word-and-result-windows.patch
blob: 50b0bcfbd6d0427b2e372ff23086170cc038a430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
when search will only display the search index not the translate result

From: Xiangfu Liu <xiangfu@sharism.cc>

when press "enter" will goto the translate result text
"esc" will go back or new search

Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
---

 src/mainwin.cpp  |   27 ++++++++++++++++++++-------
 src/mainwin.h    |    1 +
 src/stardict.cpp |    4 ++++
 3 files changed, 25 insertions(+), 7 deletions(-)


diff --git a/src/mainwin.cpp b/src/mainwin.cpp
index ccd5adc..a1d6373 100644
--- a/src/mainwin.cpp
+++ b/src/mainwin.cpp
@@ -165,8 +165,13 @@ void TopWin::on_entry_changed(GtkEntry *entry, TopWin *oTopWin)
 		return;
 	const gchar *sWord = gtk_entry_get_text(entry);
 	if(sWord[0]!='\0') {
+		gtk_widget_show(gpAppFrame->oMidWin.oIndexWin.notebook);
+		gtk_widget_hide(gpAppFrame->oMidWin.vbox1);
 		gpAppFrame->TopWinWordChange(sWord);
 	} else {
+		gtk_widget_hide(gpAppFrame->oMidWin.oIndexWin.notebook);
+		gtk_widget_show(gpAppFrame->oMidWin.vbox1);
+
 		gpAppFrame->oMidWin.oTextWin.queryWord.clear();
 		gpAppFrame->oMidWin.oIndexWin.oResultWin.Clear();
 		gpAppFrame->oMidWin.oTextWin.ShowTips();
@@ -581,8 +586,13 @@ void TopWin::SetText(const gchar *word, bool notify)
 	if (!notify)
 		return;
 	if(word[0]!='\0') {
+		gtk_widget_show(gpAppFrame->oMidWin.oIndexWin.notebook);
+		gtk_widget_hide(gpAppFrame->oMidWin.vbox1);
 		gpAppFrame->TopWinWordChange(word);
 	} else {
+		gtk_widget_hide(gpAppFrame->oMidWin.oIndexWin.notebook);
+		gtk_widget_show(gpAppFrame->oMidWin.vbox1);
+
 		gpAppFrame->oMidWin.oTextWin.queryWord.clear();
 		gpAppFrame->oMidWin.oIndexWin.oResultWin.Clear();
 		gpAppFrame->oMidWin.oTextWin.ShowTips();
@@ -1815,18 +1825,19 @@ void TextWin::ShowTips()
 {
   query_result = TEXT_WIN_TIPS;
   view->set_text(
-	  _("        Welcome to StarDict!\n\n"
+	  _("   Please type a word to start searching. \n\n"
+		"   Welcome to StarDict.\n"
 	    "   Press Ctrl+Q to quit. \n"
+	    "   Press Alt+C or ESC to clear the input entry's text.\n"
 #ifndef CONFIG_NANONOTE
         "   Press Alt+Z to iconify the window or Alt+X to hide the window.\n"
-#endif
-	    "   Press Alt+C or ESC to clear the input entry's text.\n"
 	    "   Press Space key to move focus to the input entry.\n"
-	    "   If the query word was not found, you can press Tab key to select the first word in the word list.\n"
 	    "   After selected some text, clicking the middle mouse button on the main window's Definition area or on the notification area icon will look up that word.\n"
+	    "   When the floating window reports that a word was not found, double clicking will perform a fuzzy query.\n"
+#endif
+	    "   If the query word was not found, you can press Tab key to select the first word in the word list.\n"
 	    "   StarDict can match strings against patterns containing '*' (wildcard) and '?' (joker).\n"
-	    "   Input a word beginning with \'/\' to do a Fuzzy query.\n"
-	    "   When the floating window reports that a word was not found, double clicking will perform a fuzzy query.\n")
+	    "   Input a word beginning with \'/\' to do a Fuzzy query.\n")
 	  );
   view->scroll_to(0);
 }
@@ -2689,8 +2700,10 @@ void MidWin::Create(GtkWidget *vbox)
 	oLeftWin.Create(hbox, has_treedict);
 	gtk_box_pack_start(GTK_BOX(hbox),notebook, true, true, 0);
 
-	GtkWidget *vbox1 = gtk_vbox_new(FALSE, 0);
+	vbox1 = gtk_vbox_new(FALSE, 0);
+#ifndef CONFIG_NANONOTE
 	gtk_widget_show(vbox1);
+#endif
 	oToolWin.Create(vbox1);
 	oTextWin.Create(vbox1);
 	gtk_paned_pack2(GTK_PANED(hpaned), vbox1, TRUE, FALSE);
diff --git a/src/mainwin.h b/src/mainwin.h
index c3589c6..569c978 100644
--- a/src/mainwin.h
+++ b/src/mainwin.h
@@ -307,6 +307,7 @@ class MidWin {
 public:
 	GtkWidget* hpaned;
 	GtkWidget* notebook;
+	GtkWidget* vbox1;
 
 	LeftWin oLeftWin;
 	IndexWin oIndexWin;
diff --git a/src/stardict.cpp b/src/stardict.cpp
index b84f5c5..07cb57a 100644
--- a/src/stardict.cpp
+++ b/src/stardict.cpp
@@ -425,6 +425,8 @@ void AppCore::Create(gchar *queryword)
 	} else {
 		oMidWin.oTextWin.ShowInitFailed();
 	}
+	gtk_widget_hide(oMidWin.oIndexWin.notebook);
+	gtk_widget_show(oMidWin.vbox1);
 }
 
 gboolean AppCore::on_delete_event(GtkWidget * window, GdkEvent *event , AppCore *app)
@@ -588,6 +590,8 @@ gboolean AppCore::vKeyPressReleaseCallback(GtkWidget * window, GdkEventKey *even
 					gtk_tree_model_get(model, &iter, 0, &word, -1);
 					oAppCore->ListClick(word);
 					g_free(word);
+					gtk_widget_hide(oAppCore->oMidWin.oIndexWin.notebook);
+					gtk_widget_show(oAppCore->oMidWin.vbox1);
 					/* here to dispaly the result windows */
 				}
 			}