Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit aba01cf

Browse files
committed
Merge pull request #1 from radorodopski/linux
2 parents 039c626 + bb60db1 commit aba01cf

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,13 @@ tools
3535
*.wixpdb
3636
*.wixobj
3737
bracketsharvestmanager.wxs
38-
fr-fr.mst
38+
fr-fr.mst
39+
40+
appshell_extensions_js.o
41+
Makefile
42+
appshell.Makefile
43+
Brackets.target.mk
44+
libcef_dll_wrapper.target.mk
45+
appshell/gtk
46+
appshell/gtk/*
47+

appshell/cefclient_gtk.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,14 @@ int main(int argc, char* argv[]) {
148148

149149
GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
150150

151+
#ifdef SHOW_TOOLBAR_UI
151152
GtkToolItem* back = gtk_tool_button_new(NULL, NULL);
152153
GtkToolItem* forward = gtk_tool_button_new(NULL, NULL);
153154
GtkToolItem* reload = gtk_tool_button_new(NULL, NULL);
154155
GtkToolItem* stop = gtk_tool_button_new(NULL, NULL);
155156

156157
GtkWidget* m_editWnd = gtk_entry_new();
158+
#endif // SHOW_TOOLBAR_UI
157159

158160
g_signal_connect(G_OBJECT(window), "delete_event",
159161
G_CALLBACK(HandleQuit), NULL);
@@ -165,9 +167,11 @@ int main(int argc, char* argv[]) {
165167
// Create the handler.
166168
g_handler = new ClientHandler();
167169
g_handler->SetMainHwnd(vbox);
170+
#ifdef SHOW_TOOLBAR_UI
168171
g_handler->SetEditHwnd(m_editWnd);
169172
g_handler->SetButtonHwnds(GTK_WIDGET(back), GTK_WIDGET(forward),
170173
GTK_WIDGET(reload), GTK_WIDGET(stop));
174+
#endif // SHOW_TOOLBAR_UI
171175

172176
// Create the browser view.
173177
CefWindowInfo window_info;
@@ -198,4 +202,5 @@ int main(int argc, char* argv[]) {
198202
CefShutdown();
199203

200204
return 0;
201-
}
205+
}
206+

appshell/client_handler_gtk.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ bool ClientHandler::OnBeforePopup(CefRefPtr<CefBrowser> parentBrowser,
2727
void ClientHandler::OnAddressChange(CefRefPtr<CefBrowser> browser,
2828
CefRefPtr<CefFrame> frame,
2929
const CefString& url) {
30+
#ifdef SHOW_TOOLBAR_UI
3031
REQUIRE_UI_THREAD();
3132

3233
if (m_BrowserId == browser->GetIdentifier() && frame->IsMain()) {
3334
// Set the edit window text
3435
std::string urlStr(url);
3536
gtk_entry_set_text(GTK_ENTRY(m_EditHwnd), urlStr.c_str());
3637
}
38+
#endif // SHOW_TOOLBAR_UI
3739
}
3840

3941
void ClientHandler::OnTitleChange(CefRefPtr<CefBrowser> browser,
@@ -52,13 +54,16 @@ void ClientHandler::SendNotification(NotificationType type) {
5254
}
5355

5456
void ClientHandler::SetLoading(bool isLoading) {
57+
#ifdef SHOW_TOOLBAR_UI
5558
if (isLoading)
5659
gtk_widget_set_sensitive(GTK_WIDGET(m_StopHwnd), true);
5760
else
5861
gtk_widget_set_sensitive(GTK_WIDGET(m_StopHwnd), false);
62+
#endif // SHOW_TOOLBAR_UI
5963
}
6064

6165
void ClientHandler::SetNavState(bool canGoBack, bool canGoForward) {
66+
#ifdef SHOW_TOOLBAR_UI
6267
if (canGoBack)
6368
gtk_widget_set_sensitive(GTK_WIDGET(m_BackHwnd), true);
6469
else
@@ -68,6 +73,7 @@ void ClientHandler::SetNavState(bool canGoBack, bool canGoForward) {
6873
gtk_widget_set_sensitive(GTK_WIDGET(m_ForwardHwnd), true);
6974
else
7075
gtk_widget_set_sensitive(GTK_WIDGET(m_ForwardHwnd), false);
76+
#endif // SHOW_TOOLBAR_UI
7177
}
7278

7379
void ClientHandler::CloseMainWindow() {
@@ -86,3 +92,4 @@ void ClientHandler::PopupCreated(CefRefPtr<CefBrowser> browser)
8692
bool ClientHandler::CanCloseBrowser(CefRefPtr<CefBrowser> browser) {
8793
return true;
8894
}
95+

appshell_paths.gypi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@
156156
'appshell_bundle_resources_linux': [
157157
'$(BUILDTYPE)/locales',
158158
'appshell/res/brackets.ico',
159+
'$(BUILDTYPE)/cef.pak',
160+
'$(BUILDTYPE)/cef_resources.pak',
161+
'$(BUILDTYPE)/devtools_resources.pak',
159162
],
160163
'appshell_bundle_libraries_linux': [
161164
'$(BUILDTYPE)/lib.target/libcef.so',

0 commit comments

Comments
 (0)