Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
regexxer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
regexxer
Commits
f1063aa1
Commit
f1063aa1
authored
Feb 29, 2016
by
Murray Cumming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace use of (deprecated) Gtk::Stock icons.
parent
7e77d56e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
6 deletions
+28
-6
src/filetree.cc
src/filetree.cc
+28
-6
No files found.
src/filetree.cc
View file @
f1063aa1
...
...
@@ -26,7 +26,9 @@
#include "settings.h"
#include <glibmm.h>
#include <gtkmm/stock.h>
#include <gtkmm/icontheme.h>
#include <iostream>
#include <config.h>
...
...
@@ -281,9 +283,18 @@ int FileTree::get_modified_count() const
void
FileTree
::
on_style_updated
()
{
pixbuf_directory_
=
render_icon_pixbuf
(
Gtk
::
Stock
::
DIRECTORY
,
Gtk
::
ICON_SIZE_MENU
);
pixbuf_file_
=
render_icon_pixbuf
(
Gtk
::
Stock
::
FILE
,
Gtk
::
ICON_SIZE_MENU
);
pixbuf_load_failed_
=
render_icon_pixbuf
(
Gtk
::
Stock
::
MISSING_IMAGE
,
Gtk
::
ICON_SIZE_MENU
);
auto
theme
=
Gtk
::
IconTheme
::
get_default
();
try
{
pixbuf_directory_
=
theme
->
load_icon
(
"folder"
,
Gtk
::
ICON_SIZE_MENU
);
pixbuf_file_
=
theme
->
load_icon
(
"text-x-generic"
,
Gtk
::
ICON_SIZE_MENU
);
pixbuf_load_failed_
=
theme
->
load_icon
(
"missing-image"
,
Gtk
::
ICON_SIZE_MENU
);
}
catch
(
const
Glib
::
Error
&
ex
)
{
std
::
cerr
<<
G_STRFUNC
<<
": Could not load icons: "
<<
ex
.
what
()
<<
std
::
endl
;
}
Gdk
::
RGBA
rgba
=
get_style_context
()
->
get_color
(
Gtk
::
STATE_FLAG_INSENSITIVE
);
color_load_failed_
.
set_rgba
(
rgba
.
get_red
(),
rgba
.
get_green
(),
rgba
.
get_blue
());
...
...
@@ -906,6 +917,17 @@ void FileTree::load_file_with_fallback(const Gtk::TreeModel::iterator& iter,
const
bool
old_load_failed
=
fileinfo
->
load_failed
;
auto
theme
=
Gtk
::
IconTheme
::
get_default
();
Glib
::
RefPtr
<
Gdk
::
Pixbuf
>
icon
;
try
{
icon
=
theme
->
load_icon
(
"dialog-error"
,
Gtk
::
ICON_SIZE_DIALOG
);
}
catch
(
const
Glib
::
Error
&
ex
)
{
std
::
cerr
<<
G_STRFUNC
<<
": Could not load icon: "
<<
ex
.
what
()
<<
std
::
endl
;
}
try
{
load_file
(
fileinfo
,
fallback_encoding_
);
...
...
@@ -913,14 +935,14 @@ void FileTree::load_file_with_fallback(const Gtk::TreeModel::iterator& iter,
catch
(
const
Glib
::
Error
&
error
)
{
fileinfo
->
buffer
=
FileBuffer
::
create_with_error_message
(
render_icon_pixbuf
(
Gtk
::
Stock
::
DIALOG_ERROR
,
Gtk
::
ICON_SIZE_DIALOG
)
,
error
.
what
());
icon
,
error
.
what
());
}
catch
(
const
ErrorBinaryFile
&
)
{
const
Glib
::
ustring
filename
=
(
*
iter
)[
FileTreeColumns
::
instance
().
filename
];
fileinfo
->
buffer
=
FileBuffer
::
create_with_error_message
(
render_icon_pixbuf
(
Gtk
::
Stock
::
DIALOG_ERROR
,
Gtk
::
ICON_SIZE_DIALOG
)
,
icon
,
Util
::
compose
(
_
(
"
\342\200\234
%1
\342\200\235
seems to be a binary file."
),
filename
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment