Enhancement: Fixes #542, explorer - polish existing UI
@@ -1,4 +1,4 @@
|
||||
# explorer
|
||||
This directory contains the source code for *Explorer*.
|
||||
|
||||

|
||||
<img width="580" height="351" alt="Image" src="https://github.com/user-attachments/assets/89163d0c-a26f-4c26-b897-10fa48102dae" />
|
||||
|
||||
@@ -261,6 +261,38 @@ static void wintc_explorer_application_startup(
|
||||
(G_APPLICATION_CLASS(wintc_explorer_application_parent_class))
|
||||
->startup(application);
|
||||
|
||||
// Install styles
|
||||
//
|
||||
GtkCssProvider* css_provider = gtk_css_provider_new();
|
||||
GtkCssProvider* css_provider_p = gtk_css_provider_new();
|
||||
|
||||
gtk_css_provider_load_from_resource(
|
||||
css_provider,
|
||||
"/uk/oddmatics/wintc/explorer/appstyles.css"
|
||||
);
|
||||
gtk_css_provider_load_from_resource(
|
||||
css_provider_p,
|
||||
"/uk/oddmatics/wintc/explorer/appstyles_p.css"
|
||||
);
|
||||
|
||||
gtk_style_context_add_provider_for_screen(
|
||||
gdk_screen_get_default(),
|
||||
GTK_STYLE_PROVIDER(css_provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_FALLBACK
|
||||
);
|
||||
gtk_style_context_add_provider_for_screen(
|
||||
gdk_screen_get_default(),
|
||||
GTK_STYLE_PROVIDER(css_provider_p),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
|
||||
);
|
||||
|
||||
// Install icon resource path
|
||||
//
|
||||
gtk_icon_theme_add_resource_path(
|
||||
gtk_icon_theme_get_default(),
|
||||
"/uk/oddmatics/wintc/explorer"
|
||||
);
|
||||
|
||||
// Init comctl
|
||||
//
|
||||
wintc_ctl_install_default_styles();
|
||||
|
||||
@@ -53,13 +53,45 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="receives-default">False</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Go</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">wintc-go-button</property>
|
||||
<property name="pixel-size">20</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Go</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<style>
|
||||
<class name="flat" />
|
||||
<class name="wintc-explorer-go" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
5
shell/explorer/src/res/appstyles.css
Normal file
@@ -0,0 +1,5 @@
|
||||
.wintc-explorer-go label
|
||||
{
|
||||
margin-left: 4px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
11
shell/explorer/src/res/appstyles_p.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.wintc-explorer-go
|
||||
{
|
||||
border-bottom-width: 1px;
|
||||
border-top-width: 2px;
|
||||
}
|
||||
|
||||
.wintc-explorer-throbber
|
||||
{
|
||||
background: #FFFFFF;
|
||||
padding: 0px 4px;
|
||||
}
|
||||
@@ -516,9 +516,29 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="WinTCCtlAnimation" id="throbber">
|
||||
<object class="GtkMenuBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
|
||||
<!-- FILE MENU -->
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="sensitive">False</property>
|
||||
|
||||
<child>
|
||||
<object class="WinTCCtlAnimation" id="throbber">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<style>
|
||||
<class name="wintc-explorer-throbber" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
||||
@@ -26,11 +26,22 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<object class="GtkButton" id="button-close">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="label">X</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
||||
@@ -26,11 +26,22 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<object class="GtkButton" id="button-close">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="label">X</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
<file>flag26.png</file>
|
||||
<file>flag38.png</file>
|
||||
|
||||
<!-- ICONS -->
|
||||
<file>wintc-go-button.png</file>
|
||||
<file>wintc-go-button-hot.png</file>
|
||||
|
||||
<!-- SIDEBARS -->
|
||||
<file>favside.ui</file>
|
||||
<file>fldrside.ui</file>
|
||||
@@ -13,5 +17,9 @@
|
||||
<!-- TOOLBARS -->
|
||||
<file>adrbar.ui</file>
|
||||
<file>explorer.ui</file>
|
||||
|
||||
<!-- STYLES -->
|
||||
<file>appstyles.css</file>
|
||||
<file>appstyles_p.css</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
@@ -26,17 +26,23 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<object class="GtkButton" id="button-close">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="label">X</property>
|
||||
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
|
||||
BIN
shell/explorer/src/res/wintc-go-button-hot.png
Normal file
|
After Width: | Height: | Size: 986 B |
BIN
shell/explorer/src/res/wintc-go-button.png
Normal file
|
After Width: | Height: | Size: 1002 B |
@@ -18,6 +18,11 @@ static void wintc_exp_favorites_sidebar_constructed(
|
||||
GObject* object
|
||||
);
|
||||
|
||||
static void on_button_close_clicked(
|
||||
GtkWidget* self,
|
||||
gpointer user_data
|
||||
);
|
||||
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
@@ -60,12 +65,23 @@ static void wintc_exp_favorites_sidebar_init(
|
||||
"/uk/oddmatics/wintc/explorer/favside.ui"
|
||||
);
|
||||
|
||||
sidebar->root_widget =
|
||||
GTK_WIDGET(
|
||||
g_object_ref(
|
||||
gtk_builder_get_object(builder, "main-box")
|
||||
)
|
||||
);
|
||||
GtkWidget* button_close = NULL;
|
||||
|
||||
wintc_builder_get_objects(
|
||||
builder,
|
||||
"button-close", &button_close,
|
||||
"main-box", &(sidebar->root_widget),
|
||||
NULL
|
||||
);
|
||||
|
||||
g_object_ref(sidebar->root_widget);
|
||||
|
||||
g_signal_connect(
|
||||
button_close,
|
||||
"clicked",
|
||||
G_CALLBACK(on_button_close_clicked),
|
||||
self
|
||||
);
|
||||
|
||||
g_object_unref(builder);
|
||||
}
|
||||
@@ -92,3 +108,20 @@ WinTCExplorerSidebar* wintc_exp_favorites_sidebar_new(
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// CALLBACKS
|
||||
//
|
||||
static void on_button_close_clicked(
|
||||
WINTC_UNUSED(GtkWidget* self),
|
||||
gpointer user_data
|
||||
)
|
||||
{
|
||||
WinTCExplorerSidebar* sidebar =
|
||||
WINTC_EXPLORER_SIDEBAR(user_data);
|
||||
|
||||
wintc_explorer_window_toggle_sidebar(
|
||||
WINTC_EXPLORER_WINDOW(sidebar->owner_explorer_wnd),
|
||||
WINTC_EXPLORER_SIDEBAR_ID_FAVORITES
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@ static void wintc_exp_folders_sidebar_dispose(
|
||||
GObject* object
|
||||
);
|
||||
|
||||
static void on_button_close_clicked(
|
||||
GtkWidget* self,
|
||||
gpointer user_data
|
||||
);
|
||||
static void on_explorer_window_mode_changed(
|
||||
WinTCExplorerWindow* self,
|
||||
gpointer user_data
|
||||
@@ -78,17 +82,25 @@ static void wintc_exp_folders_sidebar_init(
|
||||
"/uk/oddmatics/wintc/explorer/fldrside.ui"
|
||||
);
|
||||
|
||||
sidebar->root_widget =
|
||||
GTK_WIDGET(
|
||||
gtk_builder_get_object(builder, "main-box")
|
||||
);
|
||||
self->tree_view =
|
||||
GTK_WIDGET(
|
||||
gtk_builder_get_object(builder, "tree-view")
|
||||
);
|
||||
GtkWidget* button_close = NULL;
|
||||
|
||||
wintc_builder_get_objects(
|
||||
builder,
|
||||
"button-close", &button_close,
|
||||
"main-box", &(sidebar->root_widget),
|
||||
"tree-view", &(self->tree_view),
|
||||
NULL
|
||||
);
|
||||
|
||||
g_object_ref(sidebar->root_widget);
|
||||
|
||||
g_signal_connect(
|
||||
button_close,
|
||||
"clicked",
|
||||
G_CALLBACK(on_button_close_clicked),
|
||||
self
|
||||
);
|
||||
|
||||
g_object_unref(builder);
|
||||
}
|
||||
|
||||
@@ -168,6 +180,20 @@ WinTCExplorerSidebar* wintc_exp_folders_sidebar_new(
|
||||
//
|
||||
// CALLBACKS
|
||||
//
|
||||
static void on_button_close_clicked(
|
||||
WINTC_UNUSED(GtkWidget* self),
|
||||
gpointer user_data
|
||||
)
|
||||
{
|
||||
WinTCExplorerSidebar* sidebar =
|
||||
WINTC_EXPLORER_SIDEBAR(user_data);
|
||||
|
||||
wintc_explorer_window_toggle_sidebar(
|
||||
WINTC_EXPLORER_WINDOW(sidebar->owner_explorer_wnd),
|
||||
WINTC_EXPLORER_SIDEBAR_ID_FOLDERS
|
||||
);
|
||||
}
|
||||
|
||||
static void on_explorer_window_mode_changed(
|
||||
WinTCExplorerWindow* self,
|
||||
gpointer user_data
|
||||
|
||||
@@ -18,6 +18,11 @@ static void wintc_exp_search_sidebar_constructed(
|
||||
GObject* object
|
||||
);
|
||||
|
||||
static void on_button_close_clicked(
|
||||
GtkWidget* self,
|
||||
gpointer user_data
|
||||
);
|
||||
|
||||
//
|
||||
// GTK OOP CLASS/INSTANCE DEFINITIONS
|
||||
//
|
||||
@@ -60,12 +65,23 @@ static void wintc_exp_search_sidebar_init(
|
||||
"/uk/oddmatics/wintc/explorer/srchside.ui"
|
||||
);
|
||||
|
||||
sidebar->root_widget =
|
||||
GTK_WIDGET(
|
||||
g_object_ref(
|
||||
gtk_builder_get_object(builder, "main-box")
|
||||
)
|
||||
);
|
||||
GtkWidget* button_close = NULL;
|
||||
|
||||
wintc_builder_get_objects(
|
||||
builder,
|
||||
"button-close", &button_close,
|
||||
"main-box", &(sidebar->root_widget),
|
||||
NULL
|
||||
);
|
||||
|
||||
g_object_ref(sidebar->root_widget);
|
||||
|
||||
g_signal_connect(
|
||||
button_close,
|
||||
"clicked",
|
||||
G_CALLBACK(on_button_close_clicked),
|
||||
self
|
||||
);
|
||||
|
||||
g_object_unref(builder);
|
||||
}
|
||||
@@ -92,3 +108,20 @@ WinTCExplorerSidebar* wintc_exp_search_sidebar_new(
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// CALLBACKS
|
||||
//
|
||||
static void on_button_close_clicked(
|
||||
WINTC_UNUSED(GtkWidget* self),
|
||||
gpointer user_data
|
||||
)
|
||||
{
|
||||
WinTCExplorerSidebar* sidebar =
|
||||
WINTC_EXPLORER_SIDEBAR(user_data);
|
||||
|
||||
wintc_explorer_window_toggle_sidebar(
|
||||
WINTC_EXPLORER_WINDOW(sidebar->owner_explorer_wnd),
|
||||
WINTC_EXPLORER_SIDEBAR_ID_SEARCH
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1024,6 +1024,10 @@ static void switch_mode_to(
|
||||
wnd->iconview_browser
|
||||
);
|
||||
|
||||
gtk_widget_grab_focus(
|
||||
wnd->iconview_browser
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
case WINTC_EXPLORER_WINDOW_MODE_INTERNET:
|
||||
@@ -1065,6 +1069,10 @@ static void switch_mode_to(
|
||||
wnd->webkit_browser
|
||||
);
|
||||
|
||||
gtk_widget_grab_focus(
|
||||
wnd->webkit_browser
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -26,6 +26,11 @@ menubar,
|
||||
|
||||
-GtkWidget-window-dragging: true;
|
||||
|
||||
&:first-child
|
||||
{
|
||||
border-left-width: 0px;
|
||||
}
|
||||
|
||||
box.vertical > &:last-child
|
||||
{
|
||||
border-bottom-style: none;
|
||||
|
||||
@@ -22,6 +22,11 @@ toolbar
|
||||
|
||||
padding: 4px 3px 3px 4px;
|
||||
|
||||
&:first-child
|
||||
{
|
||||
border-left-width: 0px;
|
||||
}
|
||||
|
||||
// RORY: This is an attempt to avoid weird borders on frames... see
|
||||
// issue #334
|
||||
//
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 106 B |
@@ -20,7 +20,7 @@ $menustrip_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ $toolbar_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
|
Before Width: | Height: | Size: 472 B After Width: | Height: | Size: 106 B |
@@ -20,7 +20,7 @@ $menustrip_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ $toolbar_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
|
Before Width: | Height: | Size: 472 B After Width: | Height: | Size: 106 B |
@@ -21,7 +21,7 @@ $menustrip_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ $toolbar_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
|
Before Width: | Height: | Size: 472 B After Width: | Height: | Size: 106 B |
@@ -20,7 +20,7 @@ $menustrip_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ $toolbar_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 106 B |
@@ -20,7 +20,7 @@ $menustrip_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ $toolbar_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 106 B |
@@ -20,7 +20,7 @@ $menustrip_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
@@ -20,7 +20,7 @@ $toolbar_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 106 B |
@@ -21,7 +21,7 @@ $menustrip_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ $toolbar_styles:
|
||||
0,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
2,
|
||||
undefined,
|
||||
url('../Resources/toolbar_border.png')
|
||||
);
|
||||
|
||||