Menu

#1439 scite with selectable pathbar

Committed
closed
nobody
5
2022-07-09
2022-06-20
No

Maybe it's interesting and someone will implement it to future releases.
I added a property selected feature for my personal scite.
The text (filepath) in pathbar is selectable and can be copied with this patch.

--- _523/scite/gtk/SciTEGTK.cxx
+++ 523/scite/gtk/SciTEGTK.cxx
@@ -902,8 +902,15 @@
            const FilePath &fp = buffers.buffers[index].file;
            if (fp.IsUntitled())
                tabcontent = gtk_label_new(localiser.Text("Untitled").c_str());
-           else
+           else {
                tabcontent = gtk_label_new(fp.AsInternal());
+               if (props.GetInt("pathbar.selectable")) {
+                   gtk_label_set_selectable(GTK_LABEL(tabcontent), TRUE);
+                   gtk_widget_set_can_focus(tabcontent, FALSE);
+                   gtk_label_set_use_markup (GTK_LABEL (tabcontent), TRUE);
+                   gtk_label_set_ellipsize (GTK_LABEL (tabcontent), PANGO_ELLIPSIZE_MIDDLE);
+               }
+           }
        } else {
            // No path bar
            tabcontent = gtk_image_new();

Discussion

  • Neil Hodgson

    Neil Hodgson - 2022-06-21

    There is already File | Copy Path.

    If you really want this incorporated, the patch should add documentation and remove the extraneous spaces before (.

     
  • Neil Hodgson

    Neil Hodgson - 2022-06-21
    • labels: --> SciTE, gtk
     
  • Andre Scharfe

    Andre Scharfe - 2022-06-22

    The function File | Copy Path is known by me. It's very useful key control. I see this patch as additional feature only.
    I changed/added the patch on your request. Hopefully it's well.
    Here is the complete one which based on scite v5.2.3....

    --- scite/doc/SciTEDoc.html
    +++ scite/doc/SciTEDoc.html
    @@ -1361,6 +1361,14 @@
             <td>
               The path bar is a line of text under the tab bar showing the full path of the currently selected tab.
             Setting pathbar.visible to 1 makes the path bar visible on GTK.
    +        </td>
    +      </tr>
    +      <tr class="gtkonly" id='property-pathbar.selectable'>
    +        <td>
    +          pathbar.selectable
    +        </td>
    +        <td>
    +          Setting pathbar.selectable to 1 makes the visible path bar selectable on GTK.
             </td>
           </tr>
           <tr id='property-undo.redo.lazy'>
    
    --- scite/src/SciTEGlobal.properties
    +++ scite/src/SciTEGlobal.properties
    @@ -157,6 +157,7 @@
     #title.full.path=1
     #title.show.buffers=1
     #pathbar.visible=1
    +#pathbar.selectable=1
     #save.recent=1
     #save.session=1
     #session.bookmarks=1
    
    --- scite/gtk/SciTEGTK.cxx
    +++ scite/gtk/SciTEGTK.cxx
    @@ -902,8 +902,15 @@
                const FilePath &fp = buffers.buffers[index].file;
                if (fp.IsUntitled())
                    tabcontent = gtk_label_new(localiser.Text("Untitled").c_str());
    -           else
    +           else {
                    tabcontent = gtk_label_new(fp.AsInternal());
    +               if (props.GetInt("pathbar.selectable")) {
    +                   gtk_label_set_selectable(GTK_LABEL(tabcontent), TRUE);
    +                   gtk_widget_set_can_focus(tabcontent, FALSE);
    +                   gtk_label_set_use_markup(GTK_LABEL(tabcontent), TRUE);
    +                   gtk_label_set_ellipsize(GTK_LABEL(tabcontent), PANGO_ELLIPSIZE_MIDDLE);
    +               }
    +           }
            } else {
                // No path bar
                tabcontent = gtk_image_new();
    
     
  • Neil Hodgson

    Neil Hodgson - 2022-06-24
    • Group: Initial --> Committed
     
  • Neil Hodgson

    Neil Hodgson - 2022-06-24

    Committed as [100559].

     

    Related

    Commit: [100559]

  • Neil Hodgson

    Neil Hodgson - 2022-07-09
    • status: open --> closed
     

Log in to post a comment.